1.Environment.DIRECTORY_PICTURES等的位置:可通过
getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()
确定,在SDCard/Android/data/包名/files文件夹下,而不在根目录下。
如创建一幅图片并显示:
File file = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), "image.jpg");
Bitmap bitmap = BitmapFactory.decodeFile(file.getPath());
imageview.setImageBitmap(bitmap);
SD卡根目录下的Pictures文件夹可通过下面的方式获取:
new File(Environment.getExternalStorageDirectory(), "/Pictures").getPath()