Hello there,
i want to make an expiration in a short form.
I want to take this code:
@Override
public boolean onOptionsItemSelected(MenuItem Item) {
switch (Item.getItemId()) {
case R.id.item1:
Intent Aktionitem1 = new Intent(this, FirstActivity.class);
startActivity(Aktionitem1);
return true;
case R.id.item2:
Intent Aktionitem2 = new Intent(this, SecondActivity.class);
startActivity(Aktionitem2);
return true;
case R.id.item3:
Intent Aktionitem3 = new Intent(this, SettingsActivity.class);
startActivity(Aktionitem3);
return true;
default:
return super.onOptionsItemSelected(Item);
}
}
in a class. So that i must edit it onces and it was updatet in every Activity.
Its like an Script for menues. The Main-Script calls this menu-Script every Time.
In simple. I just want to outsource the code.
Do you have any Idea.
Sorry if my English is not so good. Im German.
But i give my best.