android - surface view onResume crashes app -



android - surface view onResume crashes app -

i working voice recognition , surface view in app , app crashes when press home button , when 1 time again launch application background crashes...

here concern ... 1) if open photographic camera in oncreate() method , closed photographic camera on onpause() method , when launch app crashed

2) if set photographic camera opening code onresume() photographic camera doesn't start after onactivityresult() because has conflicting code.

3) if set photographic camera opening on code in both oncreate() , onresume() app crashes because photographic camera object occupied , 1 time again asking photographic camera resource in onresume() lead null pointer error.

how can resolve issue. help appreciated.

logcat:

06-20 14:54:17.452: e/androidruntime(24570): fatal exception: main 06-20 14:54:17.452: e/androidruntime(24570): java.lang.nullpointerexception 06-20 14:54:17.452: e/androidruntime(24570): @ com.client.mirrorapp.camerapreview.surfacecreated(camerapreview.java:43) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.surfaceview.updatewindow(surfaceview.java:554) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.surfaceview.access$000(surfaceview.java:81) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.surfaceview$3.onpredraw(surfaceview.java:169) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.viewtreeobserver.dispatchonpredraw(viewtreeobserver.java:693) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.viewrootimpl.performtraversals(viewrootimpl.java:1762) 06-20 14:54:17.452: e/androidruntime(24570): @ android.view.viewrootimpl.handlemessage(viewrootimpl.java:2642) 06-20 14:54:17.452: e/androidruntime(24570): @ android.os.handler.dispatchmessage(handler.java:99) 06-20 14:54:17.452: e/androidruntime(24570): @ android.os.looper.loop(looper.java:154) 06-20 14:54:17.452: e/androidruntime(24570): @ android.app.activitythread.main(activitythread.java:4624) 06-20 14:54:17.452: e/androidruntime(24570): @ java.lang.reflect.method.invokenative(native method) 06-20 14:54:17.452: e/androidruntime(24570): @ java.lang.reflect.method.invoke(method.java:511) 06-20 14:54:17.452: e/androidruntime(24570): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:809) 06-20 14:54:17.452: e/androidruntime(24570): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:576) 06-20 14:54:17.452: e/androidruntime(24570): @ dalvik.system.nativestart.main(native method)

android android-camera surfaceview onactivityresult surfaceholder

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -