Listing 16.9 for lower APIs


#1

Hi,

I think it is better to wrap setHasOptionsMenu in the Listing 16.9 as follows:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { setHasOptionsMenu(true); }

Otherwise on the device with lower API, empty menu is shown when menu button pressed.