不显示菜单按钮的任何征兆的情况下没有在任何设备默认的菜单按钮 [英] Not Showing Any Sign of Menu Button when there is not any default menu button in devices
问题描述
我工作的一个应用程序,它具有设置
屏幕,打开当用户点击OptionMenu快捷方式,显示设备上的默认按钮或任何其他标志。
I am Working on One Application which has Settings
Screen which Opens When User Click on OptionMenu Shortcut which shows on Devices as Default Button or any other Sign.
它正常工作时,有在设备默认的菜单按钮,但没有得到任何注册的菜单选项时,有没有在任何设备默认的菜单按钮。
it Works fine when there is default menu button in device but not getting any Sign for Menu Option when there is not any default menu button in devices.
我的code是如下图:
My Code is as Below:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_setting, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.btnSettingMenu:
Intent intent = new Intent(MainActivity.this,
RegisterActivity.class);
intent.putExtra("From", "MainActivity");
startActivity(intent);
break;
default:
break;
}
return true;
}
我已经refered到链接这里却苦于无法解决我的问题。
I have refered to Link HERE but could not able to solve my problem.
一点我想补充的是:我收到在仿真器菜单选项时,我是pressing 上一页
或 F2
。
Point I would like to add is: I am getting the Menu Option in Emulator when i am pressing PageUp
or F2
.
但是,当设备没有默认菜单按钮,它不显示任何其他说明三个点或一些其他的方式。
But when the Device Does not have Default Menu Button it is not Showing with any other indication as three dots or some other way.
我的提问:如何可以将用户转到我的设置界面,如果他没有找到选项菜单登录真正的设备如Nexus 7
My Question : How can User Go to my Setting Screen if he is not Finding Option Menu Sign in real devices Like Nexus 7?
在此先感谢。
推荐答案
有关显示在菜单图标在4.0以上的设备
:
如果您已声明安卓targetSdkVersion =XX
要么删除它,如果你不必需的。
Either remove it if you don't required.
或
如果你想声明一下,0F XX
下面再设置值的 14
If you want to declare it,then set value 0f xx
below 14
i.e.android:targetSdkVersion="13".
希望这会为你工作。
Hope it will work for you.
这篇关于不显示菜单按钮的任何征兆的情况下没有在任何设备默认的菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!