【发布时间】:2017-02-16 07:21:39
【问题描述】:
System.out.println("weeeeeeeee");
try {
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
System.out.println("111111");
System.out.println(Common.getIm1());
Common.getIm1().setImageBitmap(thumbnail);
}
catch(Exception e)
{
System.out.println("dakfls" + e.getMessage());
}
在那个 onactivityresult 函数中基本上发生了什么,它给了我以下错误。 dakflsAttempt 在空对象引用上调用虚拟方法“java.lang.Object android.os.Bundle.get(java.lang.String)”。在打印 1111 之前发生崩溃。 我需要完整的图像而不是缩略图
我像这样从我的片段开始调用
try
{
Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
getActivity().startActivityForResult(i, 100);
}
catch(Exception e)
{
}
【问题讨论】:
-
为什么一切都在 try-catch 中?