I’m trying to set up a main menu but it’s not appearing on my phone. The main menu xml is already set up and everything compiles, but when I try it on my phone, it doesn’t appear. And the build target is Android 4.0.3, the same as my phone. Below is the java code, I hope someone can help me with this.
package image.change;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuInflater;
public class UserInterface extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}//end onCreate
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
return true;
}//end onCreateOptionsMenu
}//end UserInterface
Try doing this…
Inflating the Menu: