为了账号安全,请及时绑定邮箱和手机立即绑定

mPhoto.setImageBitmap(mPhotoImage);

mPhoto.setImageBitmap(mPhotoImage);出问题,在图库选择图片后程序崩溃

Caused by: java.lang.NullPointerException

正在回答

3 回答

你好,测试的手机型号是? 你拿genymotion/别的手机再测试下你的代码,如果genymotion/别的手机没有问题,可能对于你的手机在选取图片时需要做特殊处理。

0 回复 有任何疑惑可以回复我~

http://img1.sycdn.imooc.com//556ee7b8000147c306300124.jpg你的这个地方出问题了,你再仔细去看看

0 回复 有任何疑惑可以回复我~

05-25 20:51:09.161: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.161: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.161: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.171: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.171: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.171: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.191: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.201: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.201: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.221: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.221: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.231: D/LauncherGraphicJni(29623): nativeInit: 

05-25 20:51:09.231: D/LauncherGraphicJni(29623): setCutAndScalePram   iconSize = 180, densityRatio = 1.000000, gDstIconSize = 172

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  Detect_Icon_Boder test leftTransparentPos = 18

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  Detect_Icon_Boder test topTransparentPos = 10

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  Detect_Icon_Boder test rightTransparentPos = 19

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  Detect_Icon_Boder test bottomTransparentPos = 10

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  scaleAndMaskBitmap test  needCut = 0, isSquare = 

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  Graphic_Mask_Bitmap_Utilites_scaleAndMaskBitmap gmaskbitmap : exactWidth is 172, exactHeight is 172

05-25 20:51:09.271: D/LauncherGraphicJni(29623):  endddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

05-25 20:51:09.311: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.321: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:09.391: D/libEGL(29623): loaded /vendor/lib/egl/libEGL_adreno.so

05-25 20:51:09.391: D/libEGL(29623): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so

05-25 20:51:09.391: D/libEGL(29623): loaded /vendor/lib/egl/libGLESv2_adreno.so

05-25 20:51:09.391: I/Adreno-EGL(29623): <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build:  ()

05-25 20:51:09.391: I/Adreno-EGL(29623): OpenGL ES Shader Compiler Version: 20.00.05

05-25 20:51:09.391: I/Adreno-EGL(29623): Build Date: 05/28/14 Wed

05-25 20:51:09.391: I/Adreno-EGL(29623): Local Branch: 

05-25 20:51:09.391: I/Adreno-EGL(29623): Remote Branch: 

05-25 20:51:09.391: I/Adreno-EGL(29623): Local Patches: 

05-25 20:51:09.391: I/Adreno-EGL(29623): Reconstruct Branch: 

05-25 20:51:09.421: D/OpenGLRenderer(29623): Enabling debug mode 0

05-25 20:51:09.441: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:34.891: E/Parcel(29623): Reading a NULL string not supported here.

05-25 20:51:38.591: D/AndroidRuntime(29623): Shutting down VM

05-25 20:51:38.591: W/dalvikvm(29623): threadid=1: thread exiting with uncaught exception (group=0x41676898)

05-25 20:51:38.591: E/AndroidRuntime(29623): FATAL EXCEPTION: main

05-25 20:51:38.591: E/AndroidRuntime(29623): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=272, result=-1, data=Intent { dat=content://media/external/images/media/122081 }} to activity {com.example.hodt/com.example.hodt.MainActivity}: java.lang.NullPointerException

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread.deliverResults(ActivityThread.java:3392)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3435)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread.access$1100(ActivityThread.java:144)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.os.Handler.dispatchMessage(Handler.java:99)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.os.Looper.loop(Looper.java:137)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread.main(ActivityThread.java:5166)

05-25 20:51:38.591: E/AndroidRuntime(29623): at java.lang.reflect.Method.invokeNative(Native Method)

05-25 20:51:38.591: E/AndroidRuntime(29623): at java.lang.reflect.Method.invoke(Method.java:525)

05-25 20:51:38.591: E/AndroidRuntime(29623): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:768)

05-25 20:51:38.591: E/AndroidRuntime(29623): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)

05-25 20:51:38.591: E/AndroidRuntime(29623): at dalvik.system.NativeStart.main(Native Method)

05-25 20:51:38.591: E/AndroidRuntime(29623): Caused by: java.lang.NullPointerException

05-25 20:51:38.591: E/AndroidRuntime(29623): at com.example.hodt.MainActivity.onActivityResult(MainActivity.java:83)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.Activity.dispatchActivityResult(Activity.java:5382)

05-25 20:51:38.591: E/AndroidRuntime(29623): at android.app.ActivityThread.deliverResults(ActivityThread.java:3388)

05-25 20:51:38.591: E/AndroidRuntime(29623): ... 11 more

错误日志,代码没错啊

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
How-old 刷脸神器
  • 参与学习       31545    人
  • 解答问题       155    个

通过第三方本课程教大家实现人脸识别,通过案例讲解原理

进入课程

mPhoto.setImageBitmap(mPhotoImage);

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信