I have a custom image preference in my Live Wallpaper that allows a user to choose an image from their SD card to use as a background. I got the code from here and haven't modified it, so it's almost exactly the same except for variable or object names.
I've been getting a few of these stack traces in my dev console:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=file:///mnt/sdcard/com.idunnolol.rageface/rage_fullpanel.png }} to activity {gilleland.software.pixelrain/gilleland.software.pixelrain.PixelRainSettings}: java.lang.NullPointerException
at android.app.ActivityThread.deliverResults(ActivityThread.java:3515)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3557)
at android.app.ActivityThread.access$2800(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at gilleland.software.pixelrain.PixelRainSettings.getRealPathFromURI(PixelRainSettings.java:107)
at gilleland.software.pixelrain.PixelRainSettings.onActivityResult(PixelRainSettings.java:90)
at android.app.Activity.dispatchActivityResult(Activity.java:3890)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3511)
... 11 more
I don't get this exception on my own phone.
I've been searching for a while to figure out what's causing the NullPointerException but most of the solutions I have found involve "ResultInfo{who=null, request=1, result=-1, data=null}". The stack traces I'm getting actually have Intents with data...so I can't figure out what the NullPointerException is from.
Any and all help is appreciated. I can provide any necessary code to help solve this. Thanks!