quot;No keyboard for id 0quot; - what does it mean?(“没有 id 0 的键盘- 这是什么意思?)
问题描述
每次我的 Optionsmenu 打开(onCreateOptionsMenu(..) 被调用),我收到以下警告:
Each time my Optionsmenu opens (onCreateOptionsMenu(..) is called), I get these warnings:
id 0 没有键盘"
和
"使用默认键映射:/system/usr/keychars/qwerty.kcm.bin"
"Using default keyMap: /system/usr/keychars/qwerty.kcm.bin"
我不明白他们的意思,有人知道吗?我不喜欢 this answer.
I couldn't find out what they mean, does anyone know ? I didn't like this answer.
这是我正在使用的简单代码:
Here's the simple code I'm using:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.optmenu_start, menu);
return true;
}
和 optmenu_start.xml:
and the optmenu_start.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/optmenu_prefs"
android:title="@string/optmenu_prefs"
android:icon="@drawable/icon_menu_prefs"
/>
<item
android:id="@+id/optmenu_help"
android:title="@string/optmenu_help"
android:icon="@drawable/icon_menu_help"
/>
</menu>
推荐答案
谷歌的答案是
" 日志是正常的;它发生在设备第一次需要键盘映射时在一个过程中."
" The log is normal; it happens the first time a keymap is needed for a device in a process. "
http://groups.google.com/group/android-developers/browse_thread/thread/477caf755085b108
因此,如果您在 Activity1 之前启动 Activity2,您会在 Activity2 而不是 Activity1 中看到警告!
So therefore if you started Activity2 before Activity1 you would see the warning in Activity2 and not Activity1!
正如我所说,我认为很多开发人员都会收到此消息,这只是警告而不是错误;可以忽略.
As I said I think a lot of developers get this message and it's just a warning not an error; it can be ignored.
这篇关于“没有 id 0 的键盘"- 这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“没有 id 0 的键盘"- 这是什么意思?
基础教程推荐
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
