Question: i'm try to apply actionbar in my android, i copied a menu xml from another app to current app (/res/layout/menu/actionbarmenu.xml)

here is the code:

```
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/media_play"
          android:icon="@android:drawable/ic_media_play"
          android:title="@string/media_play"
          android:showAsAction="ifRoom|withText"/>
    <item android:id="@+id/media_pause"
          android:icon="@android:drawable/ic_media_pause"
          android:title="@string/media_pause" 
          android:showAsAction="ifRoom|withText"/>
    <item android:id="@+id/media_previous"
          android:icon="@android:drawable/ic_media_previous"
          android:title="@string/media_previous"
          android:showAsAction="ifRoom" />
    <item android:id="@+id/media_next"
          android:icon="@android:drawable/ic_media_next"
          android:title="@string/media_next"
          android:showAsAction="ifRoom">
    </item>
</menu>

```

In every line "ifRoom|withText", there is a red underline appear and with yellow box :

```
Should use app:showAsAction with the appcompat library with 
xmlns:app="http://schemas.android.com/apk/res/auto"

```

Anyone know what is the problem?

Answer: 
You should use app namespace for menu which is part of appcompat.

```
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/auto">
    <item android:id="@+id/media_play"
        android:icon="@android:drawable/ic_media_play"
        android:title="@string/media_play"
        app:showAsAction="ifRoom|withText"/>
    <item android:id="@+id/media_pause"
        android:icon="@android:drawable/ic_media_pause"
        android:title="@string/media_pause" 
        app:showAsAction="ifRoom|withText"/>
    <item android:id="@+id/media_previous"
        android:icon="@android:drawable/ic_media_previous"
        android:title="@string/media_previous"
        app:showAsAction="ifRoom" />
    <item android:id="@+id/media_next"
        android:icon="@android:drawable/ic_media_next"
        android:title="@string/media_next"
        app:showAsAction="ifRoom">
</item> </menu>

```
The `android:showAsAction` has been added in API 11 and your app has probably lower minimum API level. You can use the AppCompat library which will provide this parameter and its desired behavior, however, to reffer the AppCompat parameter you have to call it within the right XML namespace.

The namespace is included by the suggested code added to root `<menu>` tag

```
xmlns:app="http://schemas.android.com/apk/res/auto"

```

and then you can add `app:showAsAction` to your `<item>` tags