Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法使首选项3点菜单可见_Java_Android_Android Actionbar - Fatal编程技术网

Java 无法使首选项3点菜单可见

Java 无法使首选项3点菜单可见,java,android,android-actionbar,Java,Android,Android Actionbar,我在一个应用程序上工作了很长一段时间,到目前为止,我使用了顶部有动作栏的主题 现在在动作栏中我有了3点符号(使用galaxy nexus) 我决定不再需要操作栏,当我从清单上取下它时,我不会像我应该的那样在下面看到它 你知道为什么吗 多谢各位 这是活动的代码: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layou

我在一个应用程序上工作了很长一段时间,到目前为止,我使用了顶部有动作栏的主题

现在在动作栏中我有了3点符号(使用galaxy nexus)

我决定不再需要操作栏,当我从清单上取下它时,我不会像我应该的那样在下面看到它

你知道为什么吗

多谢各位

这是活动的代码:

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);
    //initialize
   this.spMain = getSharedPreferences("main", 0);
   this.numofcourses = this.spMain.getInt("numofcources", 0);
   this.tvTotalAvarge = (TextView)findViewById(R.id.totalAvarage);
   this.mainLayout = (LinearLayout)findViewById(R.id.mainlayout);


   if(this.numofcourses ==0) {
       Intent intent = new Intent(this,Newuser.class);
       startActivity(intent);
       finish();
   }

   else this.loadCourses();
}
 public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;

}

public boolean onOptionsItemSelected(MenuItem item) {
    Intent intent =new Intent(this, Newuser.class);
    startActivity(intent);
    finish();
    return true;
}
看看这篇文章

如果您的应用程序在没有专用菜单按钮的设备上运行,系统将根据您在manifest元素中声明支持的API级别决定是否将操作溢出添加到导航栏。逻辑可以归结为:

  • 如果将minSdkVersion或targetSdkVersion设置为11或更高,系统将不会添加旧版溢出按钮

  • 否则,在Android 3.0或更高版本上运行时,系统将添加遗留溢出按钮

  • 唯一的例外是,如果您将minSdkVersion设置为10或更低,将targetSdkVersion设置为11、12或13,并且您不使用ActionBar,则在Android 4.0或更高版本的手机上运行应用程序时,系统将添加传统溢出按钮

查看这篇文章

如果您的应用程序在没有专用菜单按钮的设备上运行,系统将根据您在manifest元素中声明支持的API级别决定是否将操作溢出添加到导航栏。逻辑可以归结为:

  • 如果将minSdkVersion或targetSdkVersion设置为11或更高,系统将不会添加旧版溢出按钮

  • 否则,在Android 3.0或更高版本上运行时,系统将添加遗留溢出按钮

  • 唯一的例外是,如果您将minSdkVersion设置为10或更低,将targetSdkVersion设置为11、12或13,并且您不使用ActionBar,则在Android 4.0或更高版本的手机上运行应用程序时,系统将添加传统溢出按钮