Androidstudio根据图片路径获取本地图片的方法
-
String path="//sdcard//DCIM//a31.jpg"; File file = new File(path); if(file.exists()){ Bitmap bm = BitmapFactory.decodeFile(path); pruductImg.setImageBitmap(bm); } -
private ImageView pruductImg; pruductImg.setImageURI( Uri.fromFile(newFile(CommonParameter.getMyproduct().getmImg())) );