“溢出”菜单未在三星S3中显示,但在三星注2中显示

时间:2017-04-13 06:39:31

标签: java android xml

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预览:

Samsung S3 preview

Samsung Note 2预览版 Samsung note 2 preview

所以我的问题是如何在所有设备中显示溢出菜单     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作为代码获取技术。请评论我需要发布的内容。

谢谢!

0 个答案:

没有答案