Open Jame584 opened 10 years ago
Hi! I've tried, on a Nexus 4, the AllFiltersExample bundled with this framework and this bug occurs when i lock and then unlock the screen or i receive a phone call.
This is the logcat
03-17 15:40:58.689: E/AndroidRuntime(14304): FATAL EXCEPTION: main
03-17 15:40:58.689: E/AndroidRuntime(14304): Process: project.android.allfiltersexample, PID: 14304
03-17 15:40:58.689: E/AndroidRuntime(14304): java.lang.RuntimeException: Unable to pause activity {project.android.allfiltersexample/project.android.allfiltersexample.ImageProcessingActivity}: java.lang.RuntimeException: Method called after release()
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3062)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3017)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3707)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.access$900(ActivityThread.java:135)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.os.Handler.dispatchMessage(Handler.java:102)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.os.Looper.loop(Looper.java:136)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-17 15:40:58.689: E/AndroidRuntime(14304): at java.lang.reflect.Method.invokeNative(Native Method)
03-17 15:40:58.689: E/AndroidRuntime(14304): at java.lang.reflect.Method.invoke(Method.java:515)
03-17 15:40:58.689: E/AndroidRuntime(14304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-17 15:40:58.689: E/AndroidRuntime(14304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-17 15:40:58.689: E/AndroidRuntime(14304): at dalvik.system.NativeStart.main(Native Method)
03-17 15:40:58.689: E/AndroidRuntime(14304): Caused by: java.lang.RuntimeException: Method called after release()
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.hardware.Camera._stopPreview(Native Method)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.hardware.Camera.stopPreview(Camera.java:555)
03-17 15:40:58.689: E/AndroidRuntime(14304): at project.android.imageprocessing.input.CameraPreviewInput.onPause(CameraPreviewInput.java:179)
03-17 15:40:58.689: E/AndroidRuntime(14304): at project.android.allfiltersexample.ImageProcessingActivity.onPause(ImageProcessingActivity.java:200)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.Activity.performPause(Activity.java:5335)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1233)
03-17 15:40:58.689: E/AndroidRuntime(14304): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3048)
03-17 15:40:58.689: E/AndroidRuntime(14304): ... 12 more
then, i've tried to switch "super.onPause();" with "((CameraPreviewInput) input).onPause();" in the onPause method and it crashes with this logcat
03-17 15:43:50.190: E/AndroidRuntime(15513): FATAL EXCEPTION: main
03-17 15:43:50.190: E/AndroidRuntime(15513): Process: project.android.allfiltersexample, PID: 15513
03-17 15:43:50.190: E/AndroidRuntime(15513): java.lang.RuntimeException: Unable to start activity ComponentInfo{project.android.allfiltersexample/project.android.allfiltersexample.ImageProcessingActivity}: java.lang.RuntimeException: Fail to connect to camera service
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.access$900(ActivityThread.java:135)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.os.Handler.dispatchMessage(Handler.java:102)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.os.Looper.loop(Looper.java:136)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-17 15:43:50.190: E/AndroidRuntime(15513): at java.lang.reflect.Method.invokeNative(Native Method)
03-17 15:43:50.190: E/AndroidRuntime(15513): at java.lang.reflect.Method.invoke(Method.java:515)
03-17 15:43:50.190: E/AndroidRuntime(15513): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-17 15:43:50.190: E/AndroidRuntime(15513): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-17 15:43:50.190: E/AndroidRuntime(15513): at dalvik.system.NativeStart.main(Native Method)
03-17 15:43:50.190: E/AndroidRuntime(15513): Caused by: java.lang.RuntimeException: Fail to connect to camera service
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.hardware.Camera.native_setup(Native Method)
03-17 15:43:50.190: E/AndroidRuntime(15513): at android.hardware.Camera.
Could you give me some hints to solve this issue? Thanks in advance! ;)
I've noticed that the app crashes (i've tried also the TwoInputFilterExample) everytime i lock the screen with the camera activity on focus and then i unlock the screen. I've tried to manage this with onStop/onRestart but this solve the issue only on some devices (Asus TF201, Galaxy S4) but not in others (Galaxy S, S2).