Friday, 15 February 2013

java - Why is my action bar opening at the bottom, as opposed to the top? -



java - Why is my action bar opening at the bottom, as opposed to the top? -

i have followed tutorial shows how create simple action bar @ top of page, when finish , open action bar; opens @ bottom options menu, opposed beingness @ top? whereas want open @ top in tutorial:

http://www.androidhive.info/2013/11/android-working-with-action-bar/

any advice helpful:

xml:

<?xml version="1.0" encoding="utf-8"?> < menu xmlns:android="http://schemas.android.com/apk/res/android" > <!-- search, should appear action button --> <item android:id="@+id/action_search" android:icon="@drawable/whitecog" android:title="@string/title" android:showasaction="ifroom" /> <!-- settings, should in overflow --> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:showasaction="never" /> <!-- check updates --> <item android:id="@+id/action_check_updates" android:icon="@drawable/whitecog" android:title="@string/action_check_updates" android:showasaction="never" /> </menu>

java:

@override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.main_activity_actions, menu); homecoming super.oncreateoptionsmenu(menu); }

thanks,

callum

upon request here manifest:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.application" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="19" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.application.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name="com.example.application.displaymessageactivity" android:label="@string/title_activity_display_message" > </activity> <activity android:name="com.example.application.showteamschosen" android:label="@string/title_activity_show_teams_chosen" > </activity> </application> </manifest>

also running off 4.4.2

if have physical menu button normal overflow menu opens @ bottom. devices physical menu button - today samsung devices - not have overflow menu @ top right. default before honeycomb, has been deprecated since then. there few oem still resist notion - samsung mentioned.

for devices still have them actionbar default old behaviour , not display new hamburger overflow menu.

java android android-actionbar

No comments:

Post a Comment