App crash when Menu button is pressed on Android 2.3 -
my app has actionbar (using support v7 lib) , there actions i'd add using options menu. followed tutorial implement bar , menu, , appear expected when view loads.
the device i'm using test can fit 2 buttons in action bar, while remaining should go overflow menu.
if add 2 items menu, when press menu button, nothing happen, fine, since there no more options shown;
if add 3rd one, or force 1 not shown on action bar (by setting showasaction="never"
), , press menu button, app crash.
logcat not register error messages, shows these warnings when press menu button:
w/keycharactermap﹕ can't open keycharmap file w/keycharactermap﹕ error loading keycharmap file '/system/usr/keychars/ft5x0x_ts.kcm.bin'. hw.keyboards.65536.devname='ft5x0x_ts' w/keycharactermap﹕ using default keymap: /system/usr/keychars/qwerty.kcm.bin
full log app initialization until crash moment: http://pastebin.com/gm22h18s
these warnings appear everytime press button, regardless app running, i'd unrelated. downside output on logcat.
update: test device runs android 2.3 , app crashing when run on it. tested on kitkat emulator, , not crash on it. i've tested on gingerbread emulator , crashes. way know device not problem.
menu.xml:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:com.example.myapp="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_search" com.example.myapp:showasaction="always" android:icon="@drawable/ic_launcher" android:title="search" /> <item android:id="@+id/menu_cart" com.example.myapp:showasaction="always" android:icon="@drawable/ic_launcher" android:title="cart" /> <item android:id="@+id/menu_login" com.example.myapp:showasaction="never" android:icon="@drawable/ic_launcher" android:title="log in" /> </menu>
menu inflation:
@override public boolean oncreateoptionsmenu(menu menu) { // inflate menu items use in action bar menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.menu, menu); return super.oncreateoptionsmenu(menu); }
logcat output:
i/activitymanager( 277): start proc com.example.myapp activity com.example.myapp/.mainactivity: pid=13924 uid=10053 gids={1006, 3003, 1015}
w/keycharactermap(13924): can't open keycharmap file w/keycharactermap(13924): error loading keycharmap file '/system/usr/keychars/ft5x0x_ts.kcm.bin'. hw.keyboards.65536.devname='ft5x0x_ts' w/keycharactermap(13924): using default keymap: /system/usr/keychars/qwerty.kcm.bin
i/debug (13893): build fingerprint: 'sprd/sprdroid_base/hsdroid:2.3.5/mocordroid2.3.5/w12.20_p20.01:user/test-keys' i/debug (13893): pid: 13924, tid: 13924 >>> com.example.myapp <<< i/debug (13893): signal 11 (sigsegv), code 1 (segv_maperr), fault addr 00000001 i/debug (13893): r0 00000000 r1 00000007 r2 fffffe84 r3 00000070 i/debug (13893): r4 0000bca8 r5 40789b38 r6 ad3889dc r7 00000001 i/debug (13893): r8 003a8d98 r9 003a2e60 10 00000001 fp 41968b08 i/debug (13893): ip ad389828 sp befc5358 lr ad356e9d pc a81155c8 cpsr 20800030 i/debug (13893): d0 0000000000000000 d1 0000000000000000 i/debug (13893): d2 0000000000000000 d3 0000000000000000 i/debug (13893): d4 0000000000000000 d5 0000000000000000 i/debug (13893): d6 0000000000000000 d7 0000000000000000 i/debug (13893): d8 0000000042900000 d9 0000000000000000 i/debug (13893): d10 0000000000000000 d11 0000000000000000 i/debug (13893): d12 0000000000000000 d13 0000000000000000 i/debug (13893): d14 0000000000000000 d15 0000000000000000 i/debug (13893): d16 003a8d9860000013 d17 003a2e6000000001 i/debug (13893): d18 000000060053b820 d19 00000001003a2e60 i/debug (13893): d20 ab20faa000000006 d21 ab142fdcbefc5248 i/debug (13893): d22 0000000000000000 d23 0000000000000000 i/debug (13893): d24 3ff0000000000000 d25 0000000000000000 i/debug (13893): d26 0000000000000000 d27 0000000000000000 i/debug (13893): d28 3f137c749114f9db d29 3ff0000000000000 i/debug (13893): d30 0000000000000000 d31 3ff0000000000000 i/debug (13893): scr 60000013 i/debug (13893): i/debug (13893): #00 pc 000155c8 /system/lib/libutils.so i/debug (13893): #01 lr ad356e9d /system/lib/libandroid_runtime.so
same problem here. ok , stoped. found answer @ post
menu button crashes application when has overflow actions on api 7
it problem 0.9.1 graddle png cruncher.
Comments
Post a Comment