ADB shell am start force close error - android

I want to run my android app from ADB So I run this command
adb -s emulator-5554 shell am start -W -S -n com.example.myproj/.MainActivity
My application starts in emulator but it force closed and the message unfortunately stopped working showed on emulator screen. I try both genymotion and eclipse emulator and got same error.But when I run it from eclipse directly it does not any force close problem.
I should mention that I use ubuntu 14.04 32bit.
Please help me and say what is my mistake and how I can fix it?
ok I use logcat as result I have very long log I just put last part which I can see from command line and seems to relevant to my app
D/gralloc ( 51): Registering a buffer in the process that created it.
This may cause memory ordering problems.
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/SurfaceFlinger( 51): glCheckFramebufferStatusOES error 1304732677
E/SurfaceFlinger( 51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
W/WindowManager( 361): Screenshot failure taking screenshot for (266x425) to layer 21005
D/AndroidRuntime( 1133): Shutting down VM
I/ActivityManager( 361): Start proc com.example.myproj for activity com.example.myproj/.MainActivity: pid=1144 uid=10051 gids={50051, 1028, 1015}
D/dalvikvm( 1133): GC_CONCURRENT freed 96K, 15% free 585K/684K, paused 22ms+12ms, total 59ms
D/dalvikvm( 1144): Not late-enabling CheckJNI (already on)
I/Choreographer( 531): Skipped 32 frames! The application may be doing too much work on its main thread.
I/Choreographer( 361): Skipped 33 frames! The application may be doing too much work on its main thread.
W/dalvikvm( 1144): VFY: register1 v4 holds uninitialized ref
W/dalvikvm( 1144): VFY: bad arg 0 (into Ljava/lang/Object;)
W/dalvikvm( 1144): VFY: rejecting call to Lacteve/symbolic/Util;.write (Ljava/lang/Object;I)V
W/dalvikvm( 1144): VFY: rejecting opcode 0x71 at 0x000a
W/dalvikvm( 1144): VFY: rejected Lcom/example/myproj/MainActivity$1;.<init> (Lcom/example/myproj/MainActivity;)V
W/dalvikvm( 1144): Verifier rejected class Lcom/example/myproj/MainActivity$1;
D/AndroidRuntime( 1144): Shutting down VM
W/dalvikvm( 1144): threadid=1: thread exiting with uncaught exception (group=0xb3ae0b90)
E/AndroidRuntime( 1144): FATAL EXCEPTION: main
E/AndroidRuntime( 1144): Process: com.example.myproj, PID: 1144
E/AndroidRuntime( 1144): java.lang.VerifyError: com/example/myproj/MainActivity$1
E/AndroidRuntime( 1144): at com.example.myproj.MainActivity.dol(MainActivity.java:24)
E/AndroidRuntime( 1144): at com.example.myproj.MainActivity.onCreate(MainActivity.java:17)
E/AndroidRuntime( 1144): at android.app.Activity.performCreate(Activity.java:5243)
E/AndroidRuntime( 1144): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 1144): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
E/AndroidRuntime( 1144): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
E/AndroidRuntime( 1144): at android.app.ActivityThread.access$700(ActivityThread.java:135)
E/AndroidRuntime( 1144): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
E/AndroidRuntime( 1144): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1144): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1144): at android.app.ActivityThread.main(ActivityThread.java:4998)
E/AndroidRuntime( 1144): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1144): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1144): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
E/AndroidRuntime( 1144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
E/AndroidRuntime( 1144): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 361): Force finishing activity com.example.myproj/.MainActivity
I/WindowManager( 361): Screenshot max retries 4 of Token{b40b44d0 ActivityRecord{b40181a0 u0 com.example.myproj/.MainActivity t7 f}} appWin=Window{b41a0fe8 u0 Starting com.example.myproj} drawState=4
W/WindowManager( 361): Screenshot failure taking screenshot for (800x1280) to layer 21010
W/ActivityManager( 361): Activity pause timeout for ActivityRecord{b40181a0 u0 com.example.myproj/.MainActivity t7 f}
I/Process ( 1144): Sending signal. PID: 1144 SIG: 9
I/ActivityManager( 361): Process com.example.myproj (pid 1144) has died.
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): onLoadSoundEffects(), Error -1 while loading samples
I/Choreographer( 361): Skipped 40 frames! The application may be doing too much work on its main thread.
W/InputMethodManagerService( 361): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#b417b3a0 attribute=null, token = android.os.BinderProxy#b404fb70
D/AndroidRuntime( 1161):
D/AndroidRuntime( 1161): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 1161): CheckJNI is ON
D/dalvikvm( 1161): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 1161): Added shared lib libjavacore.so 0x0
D/dalvikvm( 1161): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 1161): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1161): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
D/dalvikvm( 1161): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 1161): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1161): failed to load memtrack module: -2
D/AndroidRuntime( 1161): Calling main entry com.android.commands.am.Am
I/ActivityManager( 361): Force stopping com.example.myproj appid=10051 user=0: from pid 1161
I/ActivityManager( 361): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.myproj/.MainActivity} from pid 1161
D/gralloc ( 51): Registering a buffer in the process that created it. This may cause memory ordering problems.
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/SurfaceFlinger( 51): glCheckFramebufferStatusOES error 1304732677
E/SurfaceFlinger( 51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
W/WindowManager( 361): Screenshot failure taking screenshot for (266x425) to layer 21005
D/AndroidRuntime( 1161): Shutting down VM
D/dalvikvm( 1161): GC_CONCURRENT freed 96K, 15% free 589K/688K, paused 23ms+32ms, total 71ms
D/dalvikvm( 1172): Not late-enabling CheckJNI (already on)
I/ActivityManager( 361): Start proc com.example.myproj for activity com.example.myproj/.MainActivity: pid=1172 uid=10051 gids={50051, 1028, 1015}
I/Choreographer( 361): Skipped 39 frames! The application may be doing too much work on its main thread.
I/Choreographer( 361): Skipped 34 frames! The application may be doing too much work on its main thread.
W/dalvikvm( 1172): VFY: register1 v4 holds uninitialized ref
W/dalvikvm( 1172): VFY: bad arg 0 (into Ljava/lang/Object;)
W/dalvikvm( 1172): VFY: rejecting call to Lacteve/symbolic/Util;.write (Ljava/lang/Object;I)V
W/dalvikvm( 1172): VFY: rejecting opcode 0x71 at 0x000a
W/dalvikvm( 1172): VFY: rejected Lcom/example/myproj/MainActivity$1;.<init> (Lcom/example/myproj/MainActivity;)V
W/dalvikvm( 1172): Verifier rejected class Lcom/example/myproj/MainActivity$1;
D/AndroidRuntime( 1172): Shutting down VM
W/dalvikvm( 1172): threadid=1: thread exiting with uncaught exception (group=0xb3ae0b90)
E/AndroidRuntime( 1172): FATAL EXCEPTION: main
E/AndroidRuntime( 1172): Process: com.example.myproj, PID: 1172
E/AndroidRuntime( 1172): java.lang.VerifyError: com/example/myproj/MainActivity$1
E/AndroidRuntime( 1172): at com.example.myproj.MainActivity.dol(MainActivity.java:24)
E/AndroidRuntime( 1172): at com.example.myproj.MainActivity.onCreate(MainActivity.java:17)
E/AndroidRuntime( 1172): at android.app.Activity.performCreate(Activity.java:5243)
E/AndroidRuntime( 1172): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 1172): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
E/AndroidRuntime( 1172): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
E/AndroidRuntime( 1172): at android.app.ActivityThread.access$700(ActivityThread.java:135)
E/AndroidRuntime( 1172): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
E/AndroidRuntime( 1172): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1172): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1172): at android.app.ActivityThread.main(ActivityThread.java:4998)
E/AndroidRuntime( 1172): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1172): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1172): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
E/AndroidRuntime( 1172): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
E/AndroidRuntime( 1172): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 361): Force finishing activity com.example.myproj/.MainActivity
I/WindowManager( 361): Screenshot max retries 4 of Token{b4186bf8 ActivityRecord{b4186a98 u0 com.example.myproj/.MainActivity t8 f}} appWin=Window{b417dc10 u0 Starting com.example.myproj} drawState=4
W/WindowManager( 361): Screenshot failure taking screenshot for (800x1280) to layer 21010
W/ActivityManager( 361): Activity pause timeout for ActivityRecord{b4186a98 u0 com.example.myproj/.MainActivity t8 f}
I/Process ( 1172): Sending signal. PID: 1172 SIG: 9
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
I/dalvikvm( 361): Jit: resizing JitTable from 4096 to 8192
I/ActivityManager( 361): Process com.example.myproj (pid 1172) has died.
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): onLoadSoundEffects(), Error -1 while loading samples
D/LightsService( 361): Excessive delay setting light: 444ms
D/LightsService( 361): Excessive delay setting light: 102ms
W/InputMethodManagerService( 361): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#b421b110 attribute=null, token = android.os.BinderProxy#b404fb70
D/dalvikvm( 361): GC_CONCURRENT freed 660K, 10% free 6734K/7468K, paused 7ms+17ms, total 344ms
D/AndroidRuntime( 1189):
D/AndroidRuntime( 1189): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 1189): CheckJNI is ON
D/dalvikvm( 1189): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 1189): Added shared lib libjavacore.so 0x0
D/dalvikvm( 1189): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 1189): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1189): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
D/dalvikvm( 1189): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 1189): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1189): failed to load memtrack module: -2
D/AndroidRuntime( 1189): Calling main entry com.android.commands.am.Am
I/ActivityManager( 361): Force stopping com.example.myproj appid=10051 user=0: from pid 1189
I/ActivityManager( 361): START u0 {flg=0x10000000 cmp=com.example.myproj/.MainActivity} from pid 1189
D/gralloc ( 51): Registering a buffer in the process that created it. This may cause memory ordering problems.
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/SurfaceFlinger( 51): glCheckFramebufferStatusOES error 1304732677
E/SurfaceFlinger( 51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
W/WindowManager( 361): Screenshot failure taking screenshot for (266x425) to layer 21005
I/ActivityManager( 361): Start proc com.example.myproj for activity com.example.myproj/.MainActivity: pid=1200 uid=10051 gids={50051, 1028, 1015}
D/dalvikvm( 1200): Not late-enabling CheckJNI (already on)
I/Choreographer( 361): Skipped 37 frames! The application may be doing too much work on its main thread.
I/Choreographer( 361): Skipped 33 frames! The application may be doing too much work on its main thread.
I/Choreographer( 531): Skipped 84 frames! The application may be doing too much work on its main thread.
W/dalvikvm( 1200): VFY: register1 v4 holds uninitialized ref
W/dalvikvm( 1200): VFY: bad arg 0 (into Ljava/lang/Object;)
W/dalvikvm( 1200): VFY: rejecting call to Lacteve/symbolic/Util;.write (Ljava/lang/Object;I)V
W/dalvikvm( 1200): VFY: rejecting opcode 0x71 at 0x000a
W/dalvikvm( 1200): VFY: rejected Lcom/example/myproj/MainActivity$1;.<init> (Lcom/example/myproj/MainActivity;)V
W/dalvikvm( 1200): Verifier rejected class Lcom/example/myproj/MainActivity$1;
D/AndroidRuntime( 1200): Shutting down VM
W/dalvikvm( 1200): threadid=1: thread exiting with uncaught exception (group=0xb3ae0b90)
E/AndroidRuntime( 1200): FATAL EXCEPTION: main
E/AndroidRuntime( 1200): Process: com.example.myproj, PID: 1200
E/AndroidRuntime( 1200): java.lang.VerifyError: com/example/myproj/MainActivity$1
E/AndroidRuntime( 1200): at com.example.myproj.MainActivity.dol(MainActivity.java:24)
E/AndroidRuntime( 1200): at com.example.myproj.MainActivity.onCreate(MainActivity.java:17)
E/AndroidRuntime( 1200): at android.app.Activity.performCreate(Activity.java:5243)
E/AndroidRuntime( 1200): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 1200): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
E/AndroidRuntime( 1200): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
E/AndroidRuntime( 1200): at android.app.ActivityThread.access$700(ActivityThread.java:135)
E/AndroidRuntime( 1200): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
E/AndroidRuntime( 1200): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1200): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1200): at android.app.ActivityThread.main(ActivityThread.java:4998)
E/AndroidRuntime( 1200): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1200): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1200): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
E/AndroidRuntime( 1200): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
E/AndroidRuntime( 1200): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 361): Force finishing activity com.example.myproj/.MainActivity
I/WindowManager( 361): Screenshot max retries 4 of Token{b4083168 ActivityRecord{b3ffc9c8 u0 com.example.myproj/.MainActivity t9 f}} appWin=Window{b401a348 u0 Starting com.example.myproj} drawState=4
W/WindowManager( 361): Screenshot failure taking screenshot for (800x1280) to layer 21010
W/ActivityManager( 361): Activity pause timeout for ActivityRecord{b3ffc9c8 u0 com.example.myproj/.MainActivity t9 f}
I/Choreographer( 361): Skipped 31 frames! The application may be doing too much work on its main thread.
E/WindowManager( 361): Starting window AppWindowToken{b41c65a8 token=Token{b4083168 ActivityRecord{b3ffc9c8 u0 com.example.myproj/.MainActivity t9}}} timed out
W/ActivityManager( 361): Activity destroy timeout for ActivityRecord{b3ffc9c8 u0 com.example.myproj/.MainActivity t9 f}
D/dalvikvm( 531): GC_CONCURRENT freed 894K, 16% free 5380K/6392K, paused 78ms+17ms, total 167ms
D/dalvikvm( 515): GC_CONCURRENT freed 322K, 12% free 3340K/3780K, paused 6ms+7ms, total 64ms
I/Process ( 1200): Sending signal. PID: 1200 SIG: 9
W/InputMethodManagerService( 361): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#b404f558 attribute=null, token = android.os.BinderProxy#b404fb70
I/ActivityManager( 361): Process com.example.myproj (pid 1200) has died.
D/ConnectivityService( 361): Sampling interval elapsed, updating statistics ..
D/ConnectivityService( 361): Done.
D/ConnectivityService( 361): Setting timer for 720seconds
D/dalvikvm( 515): GC_CONCURRENT freed 436K, 14% free 3290K/3792K, paused 4ms+5ms, total 41ms
D/AndroidRuntime( 1240):
D/AndroidRuntime( 1240): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 1240): CheckJNI is ON
D/dalvikvm( 1240): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 1240): Added shared lib libjavacore.so 0x0
D/dalvikvm( 1240): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 1240): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1240): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
D/dalvikvm( 1240): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 1240): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1240): failed to load memtrack module: -2
D/AndroidRuntime( 1240): Calling main entry com.android.commands.am.Am
I/ActivityManager( 361): Force stopping com.example.myproj appid=10051 user=0: from pid 1240
I/ActivityManager( 361): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=logcat cmp=com.example.myproj/.MainActivity} from pid 1240
D/gralloc ( 51): Registering a buffer in the process that created it. This may cause memory ordering problems.
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
E/SurfaceFlinger( 51): glCheckFramebufferStatusOES error 1304732677
E/SurfaceFlinger( 51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
E/libEGL ( 51): called unimplemented OpenGL ES API
E/libEGL ( 51): called unimplemented OpenGL ES API
W/WindowManager( 361): Screenshot failure taking screenshot for (266x425) to layer 21005
I/ActivityManager( 361): Start proc com.example.myproj for activity com.example.myproj/.MainActivity: pid=1251 uid=10051 gids={50051, 1028, 1015}
D/dalvikvm( 1251): Not late-enabling CheckJNI (already on)
I/Choreographer( 361): Skipped 44 frames! The application may be doing too much work on its main thread.
W/dalvikvm( 1251): VFY: register1 v4 holds uninitialized ref
W/dalvikvm( 1251): VFY: bad arg 0 (into Ljava/lang/Object;)
W/dalvikvm( 1251): VFY: rejecting call to Lacteve/symbolic/Util;.write (Ljava/lang/Object;I)V
W/dalvikvm( 1251): VFY: rejecting opcode 0x71 at 0x000a
W/dalvikvm( 1251): VFY: rejected Lcom/example/myproj/MainActivity$1;.<init> (Lcom/example/myproj/MainActivity;)V
W/dalvikvm( 1251): Verifier rejected class Lcom/example/myproj/MainActivity$1;
D/AndroidRuntime( 1251): Shutting down VM
W/dalvikvm( 1251): threadid=1: thread exiting with uncaught exception (group=0xb3ae0b90)
E/AndroidRuntime( 1251): FATAL EXCEPTION: main
E/AndroidRuntime( 1251): Process: com.example.myproj, PID: 1251
E/AndroidRuntime( 1251): java.lang.VerifyError: com/example/myproj/MainActivity$1
E/AndroidRuntime( 1251): at com.example.myproj.MainActivity.dol(MainActivity.java:24)
E/AndroidRuntime( 1251): at com.example.myproj.MainActivity.onCreate(MainActivity.java:17)
E/AndroidRuntime( 1251): at android.app.Activity.performCreate(Activity.java:5243)
E/AndroidRuntime( 1251): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 1251): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
E/AndroidRuntime( 1251): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
E/AndroidRuntime( 1251): at android.app.ActivityThread.access$700(ActivityThread.java:135)
E/AndroidRuntime( 1251): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
E/AndroidRuntime( 1251): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1251): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1251): at android.app.ActivityThread.main(ActivityThread.java:4998)
E/AndroidRuntime( 1251): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1251): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1251): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
E/AndroidRuntime( 1251): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
E/AndroidRuntime( 1251): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 361): Force finishing activity com.example.myproj/.MainActivity
I/WindowManager( 361): Screenshot max retries 4 of Token{b41deb30 ActivityRecord{b4232990 u0 com.example.myproj/.MainActivity t10 f}} appWin=Window{b423e4b0 u0 Starting com.example.myproj} drawState=4
W/WindowManager( 361): Screenshot failure taking screenshot for (800x1280) to layer 21010
D/dalvikvm( 361): GC_CONCURRENT freed 1117K, 16% free 6529K/7720K, paused 16ms+34ms, total 347ms
W/ActivityManager( 361): Activity pause timeout for ActivityRecord{b4232990 u0 com.example.myproj/.MainActivity t10 f}
I/Choreographer( 531): Skipped 46 frames! The application may be doing too much work on its main thread.
D/LightsService( 361): Excessive delay setting light: 82ms
D/LightsService( 361): Excessive delay setting light: 426ms
I/Choreographer( 361): Skipped 37 frames! The application may be doing too much work on its main thread.
D/LightsService( 361): Excessive delay setting light: 1681ms
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
E/SoundPool( 361): error loading /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService( 361): onLoadSoundEffects(), Error -1 while loading samples
I/Process ( 1251): Sending signal. PID: 1251 SIG: 9
D/LightsService( 361): Excessive delay setting light: 320ms
D/LightsService( 361): Excessive delay setting light: 190ms
D/LightsService( 361): Excessive delay setting light: 73ms
I/ActivityManager( 361): Process com.example.myproj (pid 1251) has died.
W/InputMethodManagerService( 361): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#b3f8b170 attribute=null, token = android.os.BinderProxy#b404fb70
E/WindowManager( 361): Starting window AppWindowToken{b4233820 token=Token{b41deb30 ActivityRecord{b4232990 u0 com.example.myproj/.MainActivity t10}}} timed out
I/ActivityManager( 361): Killing 564:com.android.printspooler/u0a38 (adj 15): empty for 1807s
I/ProcessStatsService( 361): Prepared write state in 25ms
I/ProcessStatsService( 361): Prepared write state in 16ms

Related

MonkeyRunner causing Android Settings to Crash

I've been trying to turn on an Accessibility Service using Android's. I run an emulator using Android Studio (Nexus S API 19, armabi-v7). I'm able to open the accessibility settings when the emulator is running. (By clicking on the circled submenu)
Setting Screen with Accessibility Sub-Menu highlighted
Yet when I run try to attach monkeyrunner by opening an interactive monkeyrunner terminal and running:
>> from android.com.monkeyrunner import MonkeyRunner, MonkeyDevice
>> d = MonkeyRunner.waitForConnection()
I'm unable to get navigate to the accessibility settings screen and get the error message
Result of selecting accessibility sub-menu from settings when MonkeyDevice is attached
as soon as I detach the monkeyDevice, I'm able to get to the accessibility settings screen again. Any idea what could cause it?
snippet from the logs when there's an error:
##Logs from Failure ## I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 519 ... I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 751
...
D/SubSettings( 751): Launching fragment com.android.settings.accessibility.AccessibilitySettings ... E/AndroidRuntime( 751): FATAL EXCEPTION: main
E/AndroidRuntime( 751): Process: com.android.settings, PID: 751
E/AndroidRuntime( 751): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException
E/AndroidRuntime( 751): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2774)
E/AndroidRuntime( 751): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2803)
E/AndroidRuntime( 751): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2238)
E/AndroidRuntime( 751): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 751): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 751): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 751): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 751): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 751): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 751): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 751): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 751): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 751): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 751): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 751): at com.android.settings.accessibility.AccessibilitySettings.loadInstalledServices(AccessibilitySettings.java:641)
E/AndroidRuntime( 751): at com.android.settings.accessibility.AccessibilitySettings.onResume(AccessibilitySettings.java:214)
E/AndroidRuntime( 751): at android.app.Fragment.performResume(Fragment.java:1743)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:924)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1863)
E/AndroidRuntime( 751): at android.app.Activity.performResume(Activity.java:5320)
E/AndroidRuntime( 751): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2764)
E/AndroidRuntime( 751): ... 12 more
W/ActivityManager( 357): Force finishing activity com.android.settings/.SubSettings
W/ActivityManager( 357): Force finishing activity com.android.settings/.Settings ... W/ActivityManager( 357): Activity pause timeout for ActivityRecord{b3ea9e08 u0 com.android.settings/.SubSettings t2 f}
There seems to be a NullPointer exception, but I don't know what could cause that
##Log Snippet Without Failure I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 519
I/ActivityManager( 357): Start proc com.android.settings for activity com.android.settings/.Settings: pid=1095 uid=1000 gids={41000, 1028, 1015, 3002, 3001, 3003}
D/dalvikvm( 59): GC_EXPLICIT freed 40K, 5% free 2777K/2900K, paused 15ms+3ms, total 96ms
D/dalvikvm( 59): GC_EXPLICIT freed <1K, 5% free 2777K/2900K, paused 3ms+14ms, total 67ms
D/dalvikvm( 59): GC_EXPLICIT freed <1K, 5% free 2777K/2900K, paused 7ms+14ms, total 76ms
D/dalvikvm( 1095): GC_FOR_ALLOC freed 118K, 7% free 2987K/3188K, paused 35ms, total 37ms
I/dalvikvm-heap( 1095): Grow heap (frag case) to 3.602MB for 635812-byte allocation
D/dalvikvm( 1095): GC_FOR_ALLOC freed 3K, 6% free 3605K/3812K, paused 44ms, total 44ms
D/dalvikvm( 1095): GC_CONCURRENT freed <1K, 6% free 3605K/3812K, paused 4ms+2ms, total 53ms
E/BluetoothAdapter( 1095): Bluetooth binder is null
D/dalvikvm( 1095): GC_CONCURRENT freed 209K, 8% free 3793K/4088K, paused 2ms+16ms, total 65ms
D/ ( 1095): HostConnection::get() New Host Connection established 0xb82ef4c0, tid 1095
W/EGL_emulation( 1095): eglSurfaceAttrib not implemented
D/OpenGLRenderer( 1095): Enabling debug mode 0
I/ActivityManager( 357): Displayed com.android.settings/.Settings:
+2s599ms
D/dalvikvm( 1095): GC_CONCURRENT freed 124K, 5% free 4057K/4268K, paused 15ms+5ms, total 101ms
I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 1095
D/SubSettings( 1095): Launching fragment com.android.settings.accessibility.AccessibilitySettings
W/EGL_emulation( 1095): eglSurfaceAttrib not implemented
D/dalvikvm( 1095): GC_CONCURRENT freed 223K, 7% free 4267K/4576K, paused 20ms+65ms, total 345ms
I/Choreographer( 1095): Skipped 120 frames! The application may be doing too much work on its main thread.
I/ActivityManager( 357): Displayed com.android.settings/.SubSettings:
+3s235ms

ListView not getting displayed?

I have a activity which uses a listview element as follows
public class List1 extends Activity
{
Context context=this;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
try{
//DB
final SQLiteDatabase db;
db = openOrCreateDatabase(
"Secret.db"
, SQLiteDatabase.CREATE_IF_NECESSARY
, null
);
db.setVersion(1);
db.setLocale(Locale.getDefault());
db.setLockingEnabled(true);
Cursor cur = db.query("tbl_user",null,null,null,null,null,null);
//DB Over
ListView listView = (ListView) findViewById(R.id.mylist);
listView.setTextFilterEnabled(true);
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item,values);
listView.setAdapter(adapter);
listView.setVisibility(0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position,long id)
//public void onItemClick(ListView<?> listview, View view, int position,long id)
{
try
{
Intent i=new Intent(List1.this,Form1.class);
i.putExtra("uid","85");
startActivity(i);
finish();
}
catch(Exception e)
{
String insert2="insert into login values("+"\""+e.toString()+"\""+");";
db.execSQL(insert2);
}
}
});
db.close();
//required
}
catch(Exception e)
{
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show();}
}
}
This is my listview.xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</RelativeLayout>
This is my list_item.xml file which has the required textview
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/tv1"
android:padding="10dp"
android:background="#drawable/textview1"
style="#style/textview_text"
android:textSize="16dp">
</TextView>
But the ListView is not working. I mean after coming to this activity the app is showing error showing "APP_NAME is stopped unexpectedly". The same code works for one or two times and then shows the above error continuously after that. May I kno why is it happening?
EDIT
This is logcat file
W/dalvikvm( 2694): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2694): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2694): java.lang.NullPointerException
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2694): at android.widget.AbsListView.obtainView(AbsList
View.java:1274)
E/AndroidRuntime( 2694): at android.widget.ListView.makeAndAddView(ListVi
ew.java:1668)
E/AndroidRuntime( 2694): at android.widget.ListView.fillDown(ListView.jav
a:637)
E/AndroidRuntime( 2694): at android.widget.ListView.fillFromTop(ListView.
java:694)
E/AndroidRuntime( 2694): at android.widget.ListView.layoutChildren(ListVi
ew.java:1521)
E/AndroidRuntime( 2694): at android.widget.AbsListView.onLayout(AbsListVi
ew.java:1113)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.RelativeLayout.onLayout(Relati
veLayout.java:900)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.setChildFrame(Lin
earLayout.java:1119)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.layoutVertical(Li
nearLayout.java:998)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.onLayout(LinearLa
yout.java:918)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.view.ViewRoot.performTraversals(ViewR
oot.java:996)
E/AndroidRuntime( 2694): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2694): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2694): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2694): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2694): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 2694): GC freed 6621 objects / 343272 bytes in 126ms
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c60cd0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c58028 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c37fa0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/Process ( 52): Sending signal. PID: 2694 SIG: 3
I/dalvikvm( 2694): threadid=7: reacting to signal 3
I/dalvikvm( 2694): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2694): Sending signal. PID: 2694 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2694) has died.
I/WindowManager( 52): WIN DEATH: Window{44d90538 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44d933c8
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2706 uid=10034 gids={3003}
D/ddm-heap( 2706): Got feature list request
D/dalvikvm( 1152): GC freed 194 objects / 8728 bytes in 88ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 262 m
s (total 8081 ms)
D/dalvikvm( 234): GC freed 44 objects / 2064 bytes in 134ms
D/AndroidRuntime( 2718):
D/AndroidRuntime( 2718): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2718): CheckJNI is ON
D/AndroidRuntime( 2718): --- registering native functions ---
D/ddm-heap( 2718): Got feature list request
D/PackageParser( 52): Scanning package: /data/app/vmdl67950.tmp
I/PackageManager( 52): Removing non-system package:com.notification
D/PackageManager( 52): Removing package com.notification
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44eb1868
D/PackageManager( 52): Scanning package com.notification
I/PackageManager( 52): /data/app/vmdl67950.tmp changed; unpacking
D/installd( 32): DexInv: --- BEGIN '/data/app/vmdl67950.tmp' ---
D/dalvikvm( 2724): DexOpt: load 40ms, verify 159ms, opt 2ms
D/installd( 32): DexInv: --- END '/data/app/vmdl67950.tmp' (success) ---
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
D/ActivityManager( 52): Uninstalling process com.notification
D/ActivityManager( 52): Force removing process ProcessRecord{44e9eb48 2706:com
.notification/10034} (com.notification/10034)
I/Process ( 52): Sending signal. PID: 2706 SIG: 9
D/ActivityManager( 52): Received spurious death notification for thread androi
d.os.BinderProxy#44eec8b8
I/installd( 32): move /data/dalvik-cache/data#app#vmdl67950.tmp#classes.dex ->
/data/dalvik-cache/data#app#com.notification.apk#classes.dex
D/PackageManager( 52): New package installed in /data/app/com.notification.apk
D/AndroidRuntime( 2718): Shutting down VM
D/dalvikvm( 2718): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2718): DestroyJavaVM shutting VM down
D/dalvikvm( 2718): HeapWorker thread shutting down
D/dalvikvm( 2718): HeapWorker thread has shut down
D/jdwp ( 2718): JDWP shutting down net...
I/dalvikvm( 2718): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2718): VM cleaning up
D/dalvikvm( 2718): LinearAlloc 0x0 used 623916 of 5242880 (11%)
D/ActivityManager( 52): Uninstalling process com.notification
I/dalvikvm( 2718): JNI: AttachCurrentThread (from ???.???)
E/AndroidRuntime( 2718): ERROR: thread attach failed
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/dalvikvm( 1152): GC freed 139 objects / 5928 bytes in 230ms
D/dalvikvm( 52): GC freed 14606 objects / 863536 bytes in 259ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
D/dalvikvm( 52): GC freed 425 objects / 17320 bytes in 275ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/AndroidRuntime( 2729):
D/AndroidRuntime( 2729): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2729): CheckJNI is ON
D/AndroidRuntime( 2729): --- registering native functions ---
D/ddm-heap( 2729): Got feature list request
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Start proc com.notification for activity com.notificat
ion/.NotificationActivity: pid=2735 uid=10034 gids={3003}
D/AndroidRuntime( 2729): Shutting down VM
D/dalvikvm( 2729): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2729): DestroyJavaVM shutting VM down
D/dalvikvm( 2729): HeapWorker thread shutting down
D/dalvikvm( 2729): HeapWorker thread has shut down
D/jdwp ( 2729): JDWP shutting down net...
I/dalvikvm( 2729): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2729): VM cleaning up
E/AndroidRuntime( 2729): ERROR: thread attach failed
D/dalvikvm( 2729): LinearAlloc 0x0 used 639500 of 5242880 (12%)
D/dalvikvm( 30): GC freed 299 objects / 11576 bytes in 264ms
D/ddm-heap( 2735): Got feature list request
D/dalvikvm( 30): GC freed 57 objects / 2432 bytes in 160ms
D/dalvikvm( 30): GC freed 2 objects / 48 bytes in 360ms
I/ActivityManager( 52): Displayed activity com.notification/.NotificationActiv
ity: 1204 ms (total 1204 ms)
W/KeyCharacterMap( 2735): No keyboard for id 0
W/KeyCharacterMap( 2735): Using default keymap: /system/usr/keychars/qwerty.kcm.
bin
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Bg (
has extras) }
I/ActivityManager( 52): Displayed activity com.notification/.Bg: 329 ms (total
329 ms)
D/dalvikvm( 1152): GC freed 2454 objects / 141000 bytes in 600ms
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.List
1 bnds=[0,152][480,248] }
W/ActivityManager( 52): startActivity called from non-Activity context; forcin
g Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.notification/.List1 bnds=[
0,152][480,248] }
D/AndroidRuntime( 2735): Shutting down VM
W/dalvikvm( 2735): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2735): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2735): java.lang.NullPointerException
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2735): at android.widget.AbsListView.obtainView(AbsList
View.java:1256)
E/AndroidRuntime( 2735): at android.widget.ListView.measureHeightOfChildr
en(ListView.java:1147)
E/AndroidRuntime( 2735): at android.widget.ListView.onMeasure(ListView.ja
va:1060)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.measureChild(Re
lativeLayout.java:554)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.onMeasure(Relat
iveLayout.java:377)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.measureVertical(L
inearLayout.java:464)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.onMeasure(LinearL
ayout.java:278)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewRoot.performTraversals(ViewR
oot.java:763)
E/AndroidRuntime( 2735): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2735): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2735): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2735): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2735): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 52): Sending signal. PID: 2735 SIG: 3
I/dalvikvm( 2735): threadid=7: reacting to signal 3
I/dalvikvm( 2735): Wrote stack trace to '/data/anr/traces.txt'
W/ActivityManager( 52): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 52): Activity idle timeout for HistoryRecord{44dcace0 com.n
otification/.List1}
I/Process ( 2735): Sending signal. PID: 2735 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2735) has died.
I/WindowManager( 52): WIN DEATH: Window{44d8db78 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2745 uid=10034 gids={3003}
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44f2e3d8
E/gralloc ( 52): [unregister] handle 0x423290 still locked (state=40000001)
D/ddm-heap( 2745): Got feature list request
D/dalvikvm( 1152): GC freed 212 objects / 9560 bytes in 82ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 240 m
s (total 16387 ms)
D/dalvikvm( 234): GC freed 43 objects / 2024 bytes in 152ms
i think your adapter should know which textViewResourceId it should use.
So try this out: ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item, R.id.tv1,values);
Change this to
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
this
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
And why do you need listView.setVisibility(0)?
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
Starting from the this spinet of code.
When the db.query returns you should rewind the cursor before starting to use it in the while loop. What if the query returns more the 50 results? Your app will crash with ArrayOutBoundException

Android NDK hellojni example fails

I'm trying to run the example from NDK package on a AT91SAM9M10-EKES board running Android 2.1
The activity fails.
This is what I get in the logcat, Can someone please guide me with this ?
D/AndroidRuntime( 1153): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 1153): CheckJNI is ON
D/AndroidRuntime( 1153): --- registering native functions ---
D/ddm-heap( 1153): Got feature list request
D/AndroidRuntime( 1153): Shutting down VM
D/dalvikvm( 1153): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 1153): DestroyJavaVM shutting VM down
D/dalvikvm( 1153): HeapWorker thread shutting down
D/dalvikvm( 1153): HeapWorker thread has shut down
D/jdwp ( 1153): JDWP shutting down net...
I/dalvikvm( 1153): Debugger has detached; object registry had 1 entries
D/dalvikvm( 1153): VM cleaning up
E/AndroidRuntime( 1153): ERROR: thread attach failed
D/dalvikvm( 1153): LinearAlloc 0x0 used 629532 of 5242880 (12%)
D/AndroidRuntime( 1161):
D/AndroidRuntime( 1161): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 1161): CheckJNI is ON
D/AndroidRuntime( 1161): --- registering native functions ---
D/ddm-heap( 1161): Got feature list request
I/ActivityManager( 767): Starting activity: Intent { act=android.intent.action.MAIN cat=android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellojni/.HelloJni }
D/AndroidRuntime( 1161): Shutting down VM
D/dalvikvm( 1161): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 1161): DestroyJavaVM shutting VM down
D/dalvikvm( 1161): HeapWorker thread shutting down
D/dalvikvm( 1161): HeapWorker thread has shut down
D/jdwp ( 1161): JDWP shutting down net...
I/dalvikvm( 1161): Debugger has detached; object registry had 1 entries
D/dalvikvm( 1161): VM cleaning up
E/AndroidRuntime( 1161): ERROR: thread attach failed
D/dalvikvm( 1161): LinearAlloc 0x0 used 639500 of 5242880 (12%)
I/ActivityManager( 767): Start proc com.example.hellojni for activity com.example.hellojni/.HelloJni: pid=1168 uid=10018 gids={1015}
D/ddm-heap( 1168): Got feature list request
W/dalvikvm( 1168): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/example/hellojni/HelloJni;.<clinit>
W/dalvikvm( 1168): Class init failed in newInstance call (Lcom/example/hellojni/HelloJni;)
D/AndroidRuntime( 1168): Shutting down VM
W/dalvikvm( 1168): threadid=3: thread exiting with uncaught exception (group=0x4001b168)
E/AndroidRuntime( 1168): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1168): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 1168): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 1168): at java.lang.Class.newInstance(Class.java:1479)
E/AndroidRuntime( 1168): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 1168): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
E/AndroidRuntime( 1168): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
E/AndroidRuntime( 1168): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime( 1168): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime( 1168): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1168): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1168): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 1168): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1168): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1168): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 1168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 1168): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1168): Caused by: java.lang.UnsatisfiedLinkError: Library hello-jni not found
E/AndroidRuntime( 1168): at java.lang.Runtime.loadLibrary(Runtime.java:489)
E/AndroidRuntime( 1168): at java.lang.System.loadLibrary(System.java:557)
E/AndroidRuntime( 1168): at com.example.hellojni.HelloJni.<clinit>(HelloJni.java:64)
E/AndroidRuntime( 1168): ... 15 more
I/Process ( 767): Sending signal. PID: 1168 SIG: 3
I/dalvikvm( 1168): threadid=7: reacting to signal 3
E/dalvikvm( 1168): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
W/ActivityManager( 767): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 767): Activity idle timeout for HistoryRecord{43d5c310 com.example.hellojni/.HelloJni}
D/dalvikvm( 813): GC freed 301 objects / 14832 bytes in 91ms
I/power ( 767): *** set_screen_state 0
E/power ( 767): Failed setting last user activity: g_error=0
W/ActivityManager( 767): Activity pause timeout for HistoryRecord{43d5c310 com.example.hellojni/.HelloJni}
D/dalvikvm( 873): GC freed 165 objects / 6624 bytes in 81ms
you hadnt built the library(.so) file of the project thats why you are getting this error, try to build the project with help of android-ndk http://developer.android.com/sdk/ndk/index.html and cygwin http://www.cygwin.com/

Embedding Google MapView crashes android app

model : zt180
firmware : android 2.1-update1-20101030
kernel : 2.6.32.9 usbandroid #1608
build number zt180-eng 2.1-update1 20101030
google maps : 4.5.1
Various crashes occur when embedding the google maps component into an android application. I'm connecting to a router via Wi-Fi for internet access. The stand-alone google maps app seems to work fine. To re-produce, start the maps app and begin scrolling around.
Will fail within a couple of minutes, occasionally on start-up (in setContentView). Most of the errors are when drawing tiles in google code. Sometimes just an Android SEGV.
NOTE : I've tested the same app on the Android developer phone 2 (os 1.6), and it works fine.
My android app is as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="043yBg1m9IiFNKXIhN5LsdeNndw2k7yrw4Ja3xQ"/>
</RelativeLayout>
import com.google.android.maps.MapActivity;
import android.os.Bundle;
public class Maps extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
protected boolean isRouteDisplayed() { return false; }
}
=========================
W/MapActivity( 2745): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher#45ebcd30
V/MapActivity( 2745): Recycling map object.
I/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 720 ms (total 720 ms)
I/MapActivity( 2745): Handling network change notification:CONNECTED
E/MapActivity( 2745): Couldn't get connection factory client
D/AndroidRuntime( 2745): Shutting down VM
W/dalvikvm( 2745): threadid=3: thread exiting with uncaught exception (group=0x4001b168)
E/AndroidRuntime( 2745): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 2745): java.lang.IncompatibleClassChangeError: interface not implemented
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.checkPaintTimeExceeded(Unknown Source)
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMap(Unknown Source)
E/AndroidRuntime( 2745): at com.google.android.maps.MapView.drawMap(MapView.java:1048)
E/AndroidRuntime( 2745): at com.google.android.maps.MapView.onDraw(MapView.java:486)
<snip>
I/Process ( 2745): Sending signal. PID: 2745 SIG: 9
I/ActivityManager( 2010): Process com.brta.android.lite (pid 2745) has died.
I/WindowManager( 2010): WIN DEATH: Window{46112878 com.brta.android.lite/com.brta.android.lite.Maps paused=false}
I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite`
======================================================================
I/MapActivity( 2863): Handling network change notification:CONNECTED
E/MapActivity( 2863): Couldn't get connection factory client
D/dalvikvm( 2863): GC freed 8114 objects / 577376 bytes in 86ms
D/dalvikvm( 2863): GC freed 685 objects / 444384 bytes in 85ms
D/dalvikvm( 2863): GC freed 3458 objects / 259456 bytes in 79ms
I/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 4407 ms (total 4407 ms)
D/AndroidRuntime( 2863): Shutting down VM
W/dalvikvm( 2863): threadid=3: thread exiting with uncaught exception (group=0x4001b168)
E/AndroidRuntime( 2863): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 2863): java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
E/AndroidRuntime( 2863): at java.util.Vector.elementAt(Vector.java:331)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawTile(Unknown Source)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMap(Unknown Source)
E/AndroidRuntime( 2863): at com.google.android.maps.MapView.drawMap(MapView.java:1048)
E/AndroidRuntime( 2863): at com.google.android.maps.MapView.onDraw(MapView.java:486)
E/AndroidRuntime( 2863): at android.view.View.draw(View.java:6535)
E/AndroidRuntime( 2863): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
E/AndroidRuntime( 2863): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
<snip>
E/AndroidRuntime( 2863): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 2010): Sending signal. PID: 2863 SIG: 3
I/dalvikvm( 2863): threadid=7: reacting to signal 3
I/dalvikvm( 2863): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2863): Sending signal. PID: 2863 SIG: 9
I/WindowManager( 2010): WIN DEATH: Window{460ac708 com.brta.android.lite/com.brta.android.lite.Maps paused=false}
I/ActivityManager( 2010): Process com.brta.android.lite (pid 2863) has died.
I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite
W/InputManagerService( 2010): Got RemoteException sending setActive(false) notification to pid 2863 uid 10046
Basically, lots of bad things start happening...
The ZT-180 does not have Google Maps, AFAIK.

Exception on ListPreferences

This is my first Android app and I've encountered an exception when trying to use the ListPreference. The application loads along with the preferences... but when i touch the ListPreference entry the applications "stops unexpectedly".
Settings.java
public class Settings extends PreferenceActivity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.addPreferencesFromResource(R.layout.settings);
}
}
settings.xml
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="chk_enabled"
android:summary="SMS response based on settings"
android:title="Enable"
/>
<ListPreference
android:title="Contacts"
android:summary="Contacs that will be sent SMSs"
android:key="list_contacts"
android:defaultValue="0"
android:entries="#array/list_entries"
android:entryValues="#array/list_values"
/>
</PreferenceScreen>
arrays.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="list_entries">
<item>All</item>
<item>WhiteList</item>
<item>BlackList</item>
</string-array>
<integer-array name="list_values">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
</resources>
This is the logcat output:
D/AndroidRuntime( 3187): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 3187): CheckJNI is OFF
D/AndroidRuntime( 3187): --- registering native functions ---
I/jdwp ( 3187): received file descriptor 16 from ADB
/ddm-heap( 3187): Got feature list request
I/ActivityManager( 86): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=tml.UI.main/.MainActivity }
D/AndroidRuntime( 3187): Shutting down VM
D/dalvikvm( 3187): DestroyJavaVM waiting for non-daemon threads to exit
I/ActivityManager( 86): Start proc tml.UI.main for activity tml.UI.main/.MainActivity: pid=3194 uid=10039 gids={1015}
D/dalvikvm( 3187): DestroyJavaVM shutting VM down
D/dalvikvm( 3187): HeapWorker thread shutting down
D/dalvikvm( 3187): HeapWorker thread has shut down
D/jdwp ( 3187): JDWP shutting down net...
D/jdwp ( 3187): +++ peer disconnected
I/dalvikvm( 3187): Debugger has detached; object registry had 1 entries
D/dalvikvm( 3187): VM cleaning up
D/dalvikvm( 3187): LinearAlloc 0x0 used 676380 of 4194304 (16%)
I/jdwp ( 3194): received file descriptor 10 from ADB
D/ddm-heap( 3194): Got feature list request
W/Resources( 3194): Converting to string: TypedValue{t=0x10/d=0x0 a=-1}
I/ActivityManager( 86): Displayed activity tml.UI.main/.MainActivity: 977 ms (total 977 ms)
D/AndroidRuntime( 3194): Shutting down VM
W/dalvikvm( 3194): threadid=3: thread exiting with uncaught exception (group=0x4001da28)
E/AndroidRuntime( 3194): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 3194): java.lang.NullPointerException
E/AndroidRuntime( 3194): at android.preference.ListPreference.findIndexOfValue(ListPreference.java:169)
E/AndroidRuntime( 3194): at android.preference.ListPreference.getValueIndex(ListPreference.java:178)
E/AndroidRuntime( 3194): at android.preference.ListPreference.onPrepareDialogBuilder(ListPreference.java:190)
E/AndroidRuntime( 3194): at android.preference.DialogPreference.showDialog(DialogPreference.java:291)
E/AndroidRuntime( 3194): at android.preference.DialogPreference.onClick(DialogPreference.java:262)
E/AndroidRuntime( 3194): at android.preference.Preference.performClick(Preference.java:811)
E/AndroidRuntime( 3194): at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)
E/AndroidRuntime( 3194): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime( 3194): at android.widget.ListView.performItemClick(ListView.java:3246)
E/AndroidRuntime( 3194): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1635)
E/AndroidRuntime( 3194): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 3194): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 3194): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3194): at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime( 3194): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3194): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3194): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 3194): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 3194): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 86): Sending signal. PID: 3194 SIG: 3
I/dalvikvm( 3194): threadid=7: reacting to signal 3
I/dalvikvm( 3194): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 3194): Sending signal. PID: 3194 SIG: 9
I/ActivityManager( 86): Process tml.UI.main (pid 3194) has died.
I/WindowManager( 86): WIN DEATH: Window{4341fd00 tml.UI.main/tml.UI.main.MainActivity paused=false}
W/UsageStats( 86): Unexpected resume of com.android.launcher while already resumed in tml.UI.main
W/InputManagerService( 86): Got RemoteException sending setActive(false) notification to pid 3194 uid 10039
I fixed it... I kept on trying and, at the end, it turns out that I cannot use an integer-array as the entryValues Source. I just changed that integer-array to a string-array and got it working.
If there's a way to use integer-array as the source for entryValues please comment.
I've been searching for a similar solution to what you are looking for, agreeing that you should be able to use an Integer array to read from and store an integer result.
A solution to this problem I found was at http://kvance.livejournal.com/1039349.html, which I found to be useful.
It doesn't quite solve the problem the way I was thinking or that way I think you want it to, instead you still specify your initial / selection values with a String array although when the ListPreference saves it back to the SharedPreferences it saves as an Integer instead of a String (doing the conversion when the user selects it), removing the need to have to convert it possibly many times throughout your application when accessing the preference value.

Categories

Resources