question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException name

See original GitHub issue

java.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:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fabian7593commented, Jul 12, 2016

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

1reaction
beingentangledcommented, Jun 29, 2016

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:

 if(mMagicalCamera.getMyPhoto()!=null){
            SaveImage(mMagicalCamera.getMyPhoto());
        }
Read more comments on GitHub >

github_iconTop Results From Across the Web

In what occasions can we get a NullPointerException("Name ...
java: throw new NullPointerException("Name is null");. There are, of course, many other Java APIs (not the Oracle Java SDK) that could throw ...
Read more >
Resolve the error "FAILED: NullPointerException Name is null ...
I get the "FAILED: NullPointerException Name is Null" error when I query my Amazon Athena table. Short description. You get this error when...
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
In Java, the java.lang.NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object.
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >
NullPointerException (Java Platform SE 7 ) - Oracle Help Center
Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found