i want to make maps. when i will try for first i have problem. this is my problem.
我想做地图。当我第一次尝试时,我有问题。这是我的问题。
this my code
这我的代码
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
in this code, i have problem
在这段代码中,我有问题。
getMenuInflater().inflate(R.menu.main, menu);
the comment is main cannot be resolved or is not a field
评论是无法解决的,也不是一个领域。
1 个解决方案
#1
1
You should have a menu.xml file in your res/menu folder (if you don't have any, make it), with a content like this:
你应该有一个菜单。在你的res/menu文件夹中(如果你没有的话),用这样的内容:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:title="YOUR_MENU_ITEM"
app:showAsAction="never"/>
</menu>
#1
1
You should have a menu.xml file in your res/menu folder (if you don't have any, make it), with a content like this:
你应该有一个菜单。在你的res/menu文件夹中(如果你没有的话),用这样的内容:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:title="YOUR_MENU_ITEM"
app:showAsAction="never"/>
</menu>