I am trying to create the "Options" menu in the Office, which is launched from the Service, and then changes its interface based on messages from the Service transmitted through the Handler.
I customize the Options menu as follows:
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, 1, 0, "Speaker");
menu.add(0, 2, 0, "Mute");
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case 1:
return true;
case 2:
return true;
}
return false;
}
But it is never called when my application starts at all.
I am having problems when I need to use a handler to change the text on the screen, since the information is transmitted in the wrong stream, can this same problem be the reason that the menu does not appear?
How can I fix this since I cannot override the method in Handler
source
share