Search code examples
javaandroidandroid-4.2-jelly-beanactivity-lifecycle

Android Jellybean Activity Lifecycle Bug


My problem only occurs when I lock the screen and only in Jellybean 4.1.2 and 4.2.2. Tested on a Galaxy mini and an HTC. Both cyanogen mod. The problem is when I lock it it's call onPause then onResume then onPause again. And when I unlock it it doesn't call any events. Whenener I press the home and navigate back it behaves normal. I have also tested on 2.3.5 (Gingerbread) it worked perfectly. How is this possible?

I think that's an error in the android os or the rom but I also think it's possible to find a work around.

Please send me an answer if you can.

03-04 20:14:30.844: D/dalvikvm(24688): Late-enabling CheckJNI
03-04 20:14:30.994: E/Trace(24688): error opening trace file: No such file or directory (2)
03-04 20:14:31.404: D/libEGL(24688): loaded /system/lib/egl/libEGL_adreno200.so
03-04 20:14:31.414: D/libEGL(24688): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
03-04 20:14:31.414: D/libEGL(24688): loaded /system/lib/egl/libGLESv2_adreno200.so
03-04 20:14:31.424: I/Adreno200-EGL(24688): <qeglDrvAPI_eglInitialize:294>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB.04.01.01.00.036_msm8960_JB_CL2644550_release_AU (CL2644550)
03-04 20:14:31.424: I/Adreno200-EGL(24688): Build Date: 07/31/12 Tue
03-04 20:14:31.424: I/Adreno200-EGL(24688): Local Branch: 
03-04 20:14:31.424: I/Adreno200-EGL(24688): Remote Branch: quic/master
03-04 20:14:31.424: I/Adreno200-EGL(24688): Local Patches: NONE
03-04 20:14:31.424: I/Adreno200-EGL(24688): Reconstruct Branch: AU_LINUX_ANDROID_JB.04.01.01.00.036 +  NOTHING
03-04 20:14:31.464: D/OpenGLRenderer(24688): Enabling debug mode 0 <- ENTERED THE APP
03-04 20:14:33.564: D/Weird Error(24688): Resumed
03-04 20:14:33.714: D/Weird Error(24688): Created
03-04 20:14:43.044: D/Weird Error(24688): Paused <- LOCKED THE SCREEN
03-04 20:14:43.244: W/IInputConnectionWrapper(24688): beginBatchEdit on inactive InputConnection
03-04 20:14:43.244: W/IInputConnectionWrapper(24688): endBatchEdit on inactive InputConnection
03-04 20:14:43.394: D/Weird Error(24688): Resumed
03-04 20:14:43.394: D/Weird Error(24688): Paused
03-04 20:16:31.294: I/dalvikvm(24688): threadid=3: reacting to signal 3
03-04 20:16:31.344: I/dalvikvm(24688): Wrote stack traces to '/data/anr/traces.txt'
03-04 20:16:38.054: E/Trace(24767): error opening trace file: No such file or directory (2)
03-04 20:16:38.384: D/libEGL(24767): loaded /system/lib/egl/libEGL_adreno200.so <- I GUESS UNLOCKED IT BUT NOTHING PROVES IT
03-04 20:16:38.384: D/libEGL(24767): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
03-04 20:16:38.394: D/libEGL(24767): loaded /system/lib/egl/libGLESv2_adreno200.so
03-04 20:16:38.394: I/Adreno200-EGL(24767): <qeglDrvAPI_eglInitialize:294>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB.04.01.01.00.036_msm8960_JB_CL2644550_release_AU (CL2644550)
03-04 20:16:38.394: I/Adreno200-EGL(24767): Build Date: 07/31/12 Tue
03-04 20:16:38.394: I/Adreno200-EGL(24767): Local Branch: 
03-04 20:16:38.394: I/Adreno200-EGL(24767): Remote Branch: quic/master
03-04 20:16:38.394: I/Adreno200-EGL(24767): Local Patches: NONE
03-04 20:16:38.394: I/Adreno200-EGL(24767): Reconstruct Branch: AU_LINUX_ANDROID_JB.04.01.01.00.036 +  NOTHING
03-04 20:16:38.434: D/OpenGLRenderer(24767): Enabling debug mode 0

Solution

  • I found it!

    I changed this:

    android:configChanges="orientation"
    

    to this:

    android:configChanges="keyboardHidden|orientation|screenSize"
    

    I'll leave the question so others experience the same problem may find an answer.