AHF
AHF

Reputation: 1072

SetContentView parameter is showing error

I am trying this :

setContentView(R.layout.activity_main);

main is my main.xml in my menu folder , but its showing me error in activity_main

error

Activity not resolved or is not a field

Same for

mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.opencv_part_java_surface_view);

and

public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

above showing error on R.menu.main

Upvotes: 0

Views: 77

Answers (1)

Hamid Shatu
Hamid Shatu

Reputation: 9700

May be you have imported android.R.java where it should be yourpackage.R.java.

If you did that then delete the import android.R and then clean and build your project.

Upvotes: 1

Related Questions