I have a really strange problem. When I use ActionBarActivity after clicking on hardware menu button (device with Android 2.3) the app closes unexpectedly without any particular error. Logcat gives only:
W/KeyCharacterMap﹕ No keyboard for id 0
W/KeyCharacterMap﹕ Using default keymap: /system/usr/keychars/qwerty.kcm.bin
30-30/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-19 15:54:48.612 30-30/? I/DEBUG﹕ Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
03-19 15:54:48.612 30-30/? I/DEBUG﹕ pid: 785, tid: 785 >>> com.myapp <<<
03-19 15:54:48.612 30-30/? I/DEBUG﹕ signal 11 (SIGSEGV), fault addr 00000002
03-19 15:54:48.612 30-30/? I/DEBUG﹕ r0 00000000 r1 00000001 r2 00000001 r3 00000002
03-19 15:54:48.612 30-30/? I/DEBUG﹕ r4 bead28a4 r5 0000aa50 r6 001240a8 r7 0022b860
...
Code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return false;
}
The issue appears if main.xml has any element.
I use 'com.android.support:appcompat-v7:19.0.+' as my gradle dependency.
All works fine when I use Activity.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…