如何访问手机内部存储中的照片 并显示它
最佳答案
这是一个基本示例,假设您有一个名为“myPics”的文件夹,其中有一张名为“clone.jpg”的图片
File imageFile = new File("/sdcard/myPics/clone.png");
if (imageFile.exists()){
//load clone.jpg into your ImageView.
Bitmap bitmap = BitmapFactory.decodeFile(imageFile.getAbsolutePath());
BitmapDrawable drawable = new BitmapDrawable(this.getResources(), bitmap);
myimageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
myimageView.setImageDrawable(drawable);
}
关于java - 显示照片android代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5263717/