I have a 'home page' on my app with a button in. I have implemented an onClickListener. I want to change to a different class when clicking the button. (Navigating to another page within the app with a differe开发者_如何转开发nt XML file) What am I doing wrong??
Intent myIntent = new Intent(this, menu_two.class);
startActivity(myIntent);
That is in the code which goes in a switch statement which identifies which button has been pressed. I am not using an XML file, layout hard coded straight from java.
Home I have given you enough information to help
thanks
First, make sure that menu_two
is an activity. If you are not using an XML, that shouldn't be a problem. Also, verify that you added menu_two to your AndroidManifest.xml
file, where you must register all activities that your app uses.
精彩评论