"No keyboard for id 0" - what does it mean?
Asked Answered
M

2

8

Each time my Optionsmenu opens (onCreateOptionsMenu(..) is called), I get these warnings:

"No keyboard for id 0"

and

"Using default keyMap: /system/usr/keychars/qwerty.kcm.bin"

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;
}

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>
Margret answered 12/6, 2011 at 11:34 Comment(2)
Were's your code, do you return to the super? I get these warnings an tbh I ignore themAmphibolite
I added the code! Do you have an idea?Margret
A
13

Google's answer is

" 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

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.

Amphibolite answered 12/6, 2011 at 16:7 Comment(1)
You're right.. in the next Activity the warning doesn't come up. I'm still not really satisfied but I'll accept that now. Thanks!Margret
T
1

As @Blundell said, it's normal. But it always consumes the first keyPressed event. Finally, I add this on init:

setFocusableInTouchMode(true);

I don't know why, but this warning message never annoys me again.

Tarmac answered 28/4, 2015 at 3:34 Comment(1)
@YoushaAleayoub, in my case, it's a customer view, I called setFocusableInTouchMode(true) in the constructor of the view.Tarmac

© 2022 - 2024 — McMap. All rights reserved.