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)'をnullオブジェクト参照で呼び出します。クラッシュは1111 を印刷する前に起こっていると私は、このコードフォトギャラリーからのAndroidイメージ
Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, 100);
を試してみて、あなたが得るこの
try
{
Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
getActivity().startActivityForResult(i, 100);
}
catch(Exception e)
{
}
次のように望むように画像のURIを使用する理由のtry-catch内のすべてのものがありますか? –