lfhuang.web3 2016-10-28 08:27 采纳率: 4.8%
浏览 1889

android 在java代码中获取本地图片的代码

String myJpgPath =“/storage/emulated/0/Pictures/Screenshots/329150184.jpg”;// 头像地址
Log.v(TAG, myJpgPath);
File file = new File(myJpgPath);
if (file.exists()) {
Bitmap bm = BitmapFactory.decodeFile(myJpgPath);
headimage.setImageBitmap(bm);
} else {
Log.v(TAG, " File Not Found!");
}

**

还有没有其他的方法 代码**

  • 写回答

2条回答 默认 最新

  • 东风玖哥 2016-10-28 11:36
    关注

    Picasso.with(context).load("file://"+"/storage/emulated/0/Pictures/Screenshots/329150184.jpg").into(headimage);

    评论

报告相同问题?