menus.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/my_account"
android:title="@string/menu_account" />
<item
android:id="@+id/puenotes"
android:title="@string/about_app" />
<item
android:id="@+id/about_developer"
android:title="@string/menu_developer" />
<item
android:id="@+id/feedback"
android:title="@string/feedback" />
<item
android:id="@+id/rate_us"
android:title="@string/rate_us" />
<item
android:id="@+id/exit"
android:title="@string/exit"
</menu>
三星S3预览:
所以我的问题是如何在所有设备中显示溢出菜单 compilesdkversion 24
defaultConfig {
applicationId "packagename"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
MenuInflater代码:
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menus, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.puenotes:
startActivity(new Intent(this, About_app.class));
break;
case R.id.my_account:
startActivity(new Intent(this, MyAccount.class));
break;
case R.id.about_developer:
startActivity(new Intent(this, Developer.class));
break;
case R.id.feedback:
startActivity(new Intent(this, Query.class));
break;
case R.id.rate_us:
AppRater.ShowRatePopup(MainActivity.this);
break;
case R.id.exit:
System.exit(0);
finish();
break;
}
//respond to menu item selection
return super.onOptionsItemSelected(item);
}
这是我关于sof的第一个问题但是我需要建议我不希望SOF作为代码获取技术。请评论我需要发布的内容。
谢谢!