0
我寫了一個簡單的代碼可以從任何圖像支持的應用程序導入圖像導入圖片從Picasa在摩托羅拉XOOM
Intent intent = new Intent(Intent.ACTION_GET_CONTENT, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);
代碼導入從圖庫圖片時,但只要我導入圖像從工作正常picasa在我的摩托羅拉xoom。它返回null,強制關閉NullPointerException
。
有沒有人對此有任何意見?
在哪裏得到'NllPointerException'? – oliholz 2011-06-15 13:23:35
將activityresult上的圖片導入爲位圖並使用其屬性後,我得到NullPointerException ..... – Rohan 2011-06-16 05:06:20
Uri selectedImageUri = data.getData(); String selectedImagePath = imageUtil.getPath(selectedImageUri,Main.this); BitmapDrawable d =(BitmapDrawable)BitmapDrawable.createFromPath(selectedImagePath); 現在,雖然訪問「d.getWidth」,我得到NullPointerException .. – Rohan 2011-06-16 05:10:17