一、調用系統相冊App,瀏覽所用圖片
Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setType("image/*"); startActivity(intent);
二、調用系統相冊,並從中選擇一張照片
Intent intent = new Intent(); intent.setAction(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
三、調用系統相冊查看單張(或特定)圖片(此處系轉載:http://java-android.blogbus.com/logs/151611473.html)
//下方是將ImageList集合中的圖片路徑轉換為可供File識別的String數據, String value = String.valueOf(mImagesList.get(pos).getPicturePath()); File file = new File(value); //下方是是通過Intent調用系統的圖片查看器的關鍵代碼 Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(file), "image/*"); startActivity(intent);