Issue
Just wondering if anyone encountered this problem before,
I am developing an android app in Xamarin (C#), and when I add a Menu file it does regenerate the resource.designer.cs file and I can find the menu reference in my code, but the second I start buidling I get the message error CS0117: 'Resource.Menu' does not contain a definition for 'testmenu'
I figured maybe somthing is wrong with the content, so I just made VS generate a default menu file but the message remains, when trying to inflate the menu.
this.MenuInflater.Inflate(Resource.Menu.testmenu, menu);
MenuFile
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_search"
android:showAsAction="always"
android:text="Search"
android:actionViewClass="android.widget.SearchView"/>
</menu>
Solution
apparently Visual Studio set the buildaction for menus to transferfile by default for some reason, I had to change the buildaction to android resource in properties of the file...
Answered By - kpp
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.