“没有 id 0 的键盘"- 这是什么意思? [英] "No keyboard for id 0" - what does it mean?

查看:24
本文介绍了“没有 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 的键盘"- 这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆