Max1809
Fortgeschrittenes Mitglied
- 6
Hallo zusammen,
ich verwende eine ActionBar aus der Support Library. Nun habe ich ActionBar-Items hinzugefügt. Leider werden mir diese nicht oben, in der ActionBar angezeigt. Kann jemand helfen???
Meine Menü-XML sieht so aus:
Jedes "Item" landet immer im Overflow. Das bedeutet, es ist nur über den Hardwarebutton "Einstellungen" meines S3 aufrufbar.
Wenn ich meine Activity von "ActionBarActivity" ableite, stürzt die Anwendung ab, sobald ich das Menü öffnen will.
ich verwende eine ActionBar aus der Support Library. Nun habe ich ActionBar-Items hinzugefügt. Leider werden mir diese nicht oben, in der ActionBar angezeigt. Kann jemand helfen???
Meine Menü-XML sieht so aus:
Code:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:yourapp="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/action_refresh"
android:icon="@drawable/refresh_white_arrow"
android:title="Aktualisieren"
yourapp:showAsAction="ifRoom|collapseActionView"/>
</menu>
Wenn ich meine Activity von "ActionBarActivity" ableite, stürzt die Anwendung ab, sobald ich das Menü öffnen will.
09-13 18:55:00.485: E/AndroidRuntime(4255): FATAL EXCEPTION: main
09-13 18:55:00.485: E/AndroidRuntime(4255): java.lang.NullPointerException
09-13 18:55:00.485: E/AndroidRuntime(4255): at android.support.v7.app.ActionBarImplICS.getThemedContext(ActionBarImplICS.java:274)
09-13 18:55:00.485: E/AndroidRuntime(4255): at android.support.v7.app.ActionBarActivityDelegate.getMenuInflater(ActionBarActivityDelegate.java:89)
09-13 18:55:00.485: E/AndroidRuntime(4255): at android.support.v7.app.ActionBarActivity.getMenuInflater(ActionBarActivity.java:71)