I followed the development pages on the Android developer site, but I canβt get the action bar to split to the top and bottom of the screen.
I have an xml menu defined with a few options:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/stop_services" android:icon="@drawable/ic_launcher" android:title="@string/stop" android:showAsAction="ifRoom|withText"/> <item android:id="@+id/start_services" android:icon="@drawable/pushpin" android:title="@string/start" android:showAsAction="ifRoom|withText"/> </menu>
In my manifest, I installed uiOption:
<activity android:label="@string/app_name" android:name=".ProxilenceHome" uiOptions="splitActionBarWhenNarrow" >
I load menu items into action as follows:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.home_menu, menu); return true; }
But when testing the application, the action bar never breaks up. Does anyone know the problem / if I missed something?
Many thanks.
source share