- Home /
Question by
Hanuman33m · Oct 15, 2016 at 06:48 AM ·
unity 5cameraandroid build
When I extended UnityPlayerActivity in android application,is it getting error?
In my application I want to open the camera and take picture and get the callback in onActivityResult(), when my activity is extends Activity class or AppCompactActivity then it is working fine, but when I extendeds to UnityPlayerActicvity it is showing error like while launching the camera intent
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3648) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3666) at android.app.ActivityThread.access$1400(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at android.os.Message.sendToTarget(Message.java:367) at com.unity3d.player.UnityPlayer$b.a(Unknown Source) at com.unity3d.player.UnityPlayer$b.a(Unknown Source) at com.unity3d.player.UnityPlayer.quit(Unknown Source) at com.unity3d.player.UnityPlayerActivity.onDestroy(Unknown Source) at android.app.Activity.performDestroy(Activity.java:5583) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3635) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3666) at android.app.ActivityThread.access$1400(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633) at dalvik.system.NativeStart.main(Native Method) Please let me know what is the reason behind to extending that UnityPlayerActivity class, I debugged it, it is going to the onDestroy() while opening camera then it is crashing I didn't added any code in that(onDestroy). It is getting error in UnityPlayer quit function, and it is calling internally , i have seen some where like it is problem with the version, So I need to change the version to working version how I have to do? http://stackoverflow.com/a/19356229/4481220Caused by: java.lang.RuntimeException: Unable to destroy activity {com.hanuman.sampleproject/com.hanuman.sampleproject.MainActivity}: java.lang.NullPointerException
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612094644im_/https://answers.unity.com/themes/thub/images/avi.jpg)