Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera activity crashes after screen unlock #11

Open
Jame584 opened this issue Mar 11, 2014 · 1 comment
Open

Camera activity crashes after screen unlock #11

Jame584 opened this issue Mar 11, 2014 · 1 comment

Comments

@Jame584
Copy link

Jame584 commented Mar 11, 2014

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).

@Jame584
Copy link
Author

Jame584 commented Mar 17, 2014

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.(Camera.java:350) 03-17 15:43:50.190: E/AndroidRuntime(15513): at android.hardware.Camera.open(Camera.java:324) 03-17 15:43:50.190: E/AndroidRuntime(15513): at project.android.imageprocessing.input.CameraPreviewInput.createCamera(CameraPreviewInput.java:54) 03-17 15:43:50.190: E/AndroidRuntime(15513): at project.android.imageprocessing.input.CameraPreviewInput.(CameraPreviewInput.java:43) 03-17 15:43:50.190: E/AndroidRuntime(15513): at project.android.allfiltersexample.ImageProcessingActivity.onCreate(ImageProcessingActivity.java:54) 03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.Activity.performCreate(Activity.java:5231) 03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 03-17 15:43:50.190: E/AndroidRuntime(15513): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 03-17 15:43:50.190: E/AndroidRuntime(15513): ... 12 more

Could you give me some hints to solve this issue? Thanks in advance! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant