FATAL EXCEPTION: main
Process: name.lmj001.savetodevice, PID: 14239
java.lang.RuntimeException: Unable to start activity ComponentInfo{name.lmj001.savetodevice/name.lmj001.saveondevice.MainActivity}: java.lang.NullPointerException: null cannot be cast to non-null type android.net.Uri
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4035)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.NullPointerException: null cannot be cast to non-null type android.net.Uri
at java.util.Objects.requireNonNull(Objects.java:245)
at name.lmj001.saveondevice.MainActivity.onCreate(MainActivity.kt:52)
at android.app.Activity.performCreate(Activity.java:8290)
at android.app.Activity.performCreate(Activity.java:8270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4009)
... 12 more
FATAL EXCEPTION: main Process: name.lmj001.savetodevice, PID: 14239 java.lang.RuntimeException: Unable to start activity ComponentInfo{name.lmj001.savetodevice/name.lmj001.saveondevice.MainActivity}: java.lang.NullPointerException: null cannot be cast to non-null type android.net.Uri at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4035) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8663) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) Caused by: java.lang.NullPointerException: null cannot be cast to non-null type android.net.Uri at java.util.Objects.requireNonNull(Objects.java:245) at name.lmj001.saveondevice.MainActivity.onCreate(MainActivity.kt:52) at android.app.Activity.performCreate(Activity.java:8290) at android.app.Activity.performCreate(Activity.java:8270) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4009) ... 12 more