I am learning Android with an Android book in action. One example is a simple application with this menu bar at the bottom of the screen. I have this code to draw a menu:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0, ReviewCriteria.MENU_GET_REVIEWS, 0, R.string.menu_get_reviews).setIcon(android.R.drawable.ic_menu_more);
return true;
}
But it is not called, so the menu does not appear. I tried to set a breakpoint on it, but it does not stop there. Should I set any other property to enable the menu in this action?
Thanks Oscar
Edit: LogCat is filled with logs regarding emulator startup. These are those related to deploying / downloading my application.
04-07 22:26:08.403: INFO/System.out(480): debugger has settled (1503)
04-07 22:26:16.404: WARN/InputManagerService(73): Got RemoteException sending setActive(false) notification to pid 447 uid 10034
04-07 22:26:16.933: INFO/ActivityManager(73): Displayed com.examples.RestaurantFinder/.ReviewCriteria: +16s325ms (total +16s431ms)
04-07 22:26:37.705: DEBUG/SntpClient(73): request time failed: java.net.SocketException: Address family not supported by protocol
04-07 22:30:24.473: ERROR/ThrottleService(73): Error reading data file
04-07 22:31:37.745: DEBUG/SntpClient(73): request time failed: java.net.SocketException: Address family not supported by protocol
It does not seem to give any information about the menu :(
source
share