I am trying to implement an ActionBar through the support library, v7. Because I want to support an application for Android 2.1 (API level 7) and higher.
I read the following at http://developer.android.com/guide/topics/ui/actionbar.html : "Using XML attributes from the support library Please note that the showAsAction attribute above uses its own namespace defined in the tag. This is necessary when using any XML attributes defined by the support library because these attributes do not exist on the Android platform on older devices. Therefore, you should use your own namespace as a prefix for all attributes defined by the support library. "
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:myapp="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/refresh" android:icon="@drawable/ic_navigation_refresh" android:title="@string/refresh" myapp:showAsAction="always"/> <item android:id="@+id/settings" android:title="@string/settings" myapp:showAsAction="always"/> <item android:id="@+id/logout" android:title="@string/logout" myapp:showAsAction="always"/> </menu>
Eclipse shows me the error "Unexpected namespace prefix" myapp "found for tag element." I do not see what I am doing wrong.
source share