namespace prefix "myapp" is not defined in Xamarin While Building App?

2.2k views Asked by At

I want to build a Toolbar in Xamarin app. When i want to create a menu it shows me error saying that "namespace prefix "myapp" is not defined". Here is code.

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/android-auto">
<item android:id="@+id/action_reply"
    android:icon="@drawable/ic_action_reply"
    android:title="Reply"
    myapp:showAsAction="always" />
<item android:id="@+id/action_undo"
    android:icon="@drawable/ic_action_undo"
    android:title="Undo"
    myapp:showAsAction="never" />
</menu>

Can anyone help me with this code?

1

There are 1 answers

6
Artur Shamsutdinov On BEST ANSWER

Why do you use myapp prefix? Use android instead.

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/android-auto">
<item android:id="@+id/action_reply"
    android:icon="@drawable/ic_action_reply"
    android:title="Reply"
    android:showAsAction ="always" />
<item android:id="@+id/action_undo"
    android:icon="@drawable/ic_action_undo"
    android:title="Undo"
    android:showAsAction ="never" />
</menu>