NullPointerException name
See original GitHub issuejava.lang.RuntimeException: Unable to resume activity {com.frosquivel.examplemagicalcamera/com.frosquivel.examplemagicalcamera.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.frosquivel.examplemagicalcamera/com.frosquivel.examplemagicalcamera.MainActivity}: java.lang.NullPointerException: name == null at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2790) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254) at android.app.ActivityThread.access$800(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5052) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.frosquivel.examplemagicalcamera/com.frosquivel.examplemagicalcamera.MainActivity}: java.lang.NullPointerException: name == null at android.app.ActivityThread.deliverResults(ActivityThread.java:3367) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2777) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254) at android.app.ActivityThread.access$800(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5052) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException: name == null at java.io.File.<init>(File.java:150) at java.io.File.<init>(File.java:124) at com.frosquivel.magicalcamera.MagicalCamera.getPhotoFileUri(MagicalCamera.java:349) at com.frosquivel.magicalcamera.MagicalCamera.onTakePhotoResult(MagicalCamera.java:229) at com.frosquivel.magicalcamera.MagicalCamera.resultPhoto(MagicalCamera.java:191) at com.frosquivel.examplemagicalcamera.MainActivity.onActivityResult(MainActivity.java:81) at android.app.Activity.dispatchActivityResult(Activity.java:5437) at android.app.ActivityThread.deliverResults(ActivityThread.java:3363) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2777)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
if you have any problem when you rotate the camera you try to fix this with android:configChanges=“orientation|screenSize” in the options of your activities (in the manifest). of save the state of the variables or image view with another methods, (but this is the more easy 😄)
hello @avew . It’s null pointer problem where the data is returned as null . I solved it by //make sure to put this line
mMagicalCamera.resultPhoto(requestCode, resultCode, data);add this for checking: