i working this tutorial, , got stuck.
i error on opensettings(); , opensearch(); program says
can not resolve method
could please tell me have done wrong?
@override public boolean onoptionsitemselected(menuitem item) { if (item.getitemid() == r.id.action_settings) { opensetting(); return true; } else if (item.getitemid() == r.id.action_search) { opensearch(); return true; } return super.onoptionsitemselected(item); }
if had guess think following example here: https://github.com/arun-gupta/android-samples/blob/master/helloworldproject/helloworld/src/main/java/name/arungupta/android/helloworld/mainactivity.java
to solve problem need add these 2 methods in class:
private void opensettings() { intent intent = new intent(this, settingsactivity.class); intent.putextra(settings_message, "settings"); startactivity(intent); } private void opensearch() { intent intent = new intent(this, searchactivity.class); intent.putextra(search_message, "search now"); startactivity(intent); }
Comments
Post a Comment