I have the following code:
public boolean onCreateOptionsMenu(Menu menu)
{
menu.add(0, AUSRECHNEN_ID, Menu.NONE,"Umrechnen");
return super.onCreateOptionsMenu(menu);
setContentView(R.layout.main);
}
I get an “unreachable code” warning right next to the setContentView() method.
What am I doing wrong?
You are returning before you get to
setContentView(R.layout.main);. Move your return after thesetContentViewif you want to use this method call.