I have referred to this blog tutorial. But, I cant figure out, where did they get "R.menu.main" in this coding?
@Override
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;
}
and.. where did they get "R.id.action_settings" ?
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
I tried to change my coding by adding a little bit based on this blog tutorial. My apps still crash, it suddenly close.