當我試圖選擇將圖片從圖庫存儲到imageview.i時,我得到了java.lang.RuntimeException
兩個意圖。從Gallery RuntimeException中選擇圖片
1.Take圖片和ImageView的
2.choose店從畫廊
但是,當我使用這個代碼MainActivity.java我得到這個異常的stoing攝像機的圖像,當我使用此代碼MainActivity.java然後獲取存儲圖庫圖片的錯誤。 該代碼有什麼問題。
如果它適用於相機圖像,那麼它不適用於圖庫,如果它的圖庫工作不適用於相機圖像。爲什麼?
這是我的相機設置圖像的日誌貓。
08-30 17:37:57.218: E/AndroidRuntime(8877): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { act=inline-data (has extras) }} to activity {org.inextrix.userprofile/org.inextrix.userprofile.MainActivity}: java.lang.NullPointerException
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread.deliverResults(ActivityThread.java:2536)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread.handleSendResult(ActivityThread.java:2578)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread.access$2000(ActivityThread.java:117)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:965)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.os.Looper.loop(Looper.java:130)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread.main(ActivityThread.java:3687)
08-30 17:37:57.218: E/AndroidRuntime(8877): at java.lang.reflect.Method.invokeNative(Native Method)
08-30 17:37:57.218: E/AndroidRuntime(8877): at java.lang.reflect.Method.invoke(Method.java:507)
08-30 17:37:57.218: E/AndroidRuntime(8877): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
08-30 17:37:57.218: E/AndroidRuntime(8877): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
08-30 17:37:57.218: E/AndroidRuntime(8877): at dalvik.system.NativeStart.main(Native Method)
08-30 17:37:57.218: E/AndroidRuntime(8877): Caused by: java.lang.NullPointerException
08-30 17:37:57.218: E/AndroidRuntime(8877): at org.inextrix.userprofile.MainActivity.onActivityResult(MainActivity.java:77)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.Activity.dispatchActivityResult(Activity.java:3908)
08-30 17:37:57.218: E/AndroidRuntime(8877): at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
08-30 17:37:57.218: E/AndroidRuntime(8877): ... 11 more
任何人之前有這個問題,或者我做錯了什麼。如果你有任何想法,然後建議我
謝謝
錯誤表示數據未從Intent正確接收。 – Swayam
改爲發佈您的代碼! – Carnal
post MainActivity.java:77行號碼 –