imageView=(ImageView)findViewById(R.id.img);
String pathName = Environment.getExternalStorageDirectory().toString() + "/person.png";
Bitmap bmp = BitmapFactory.decodeFile(pathName);
imageView.setImageBitmap(bmp);
答案 0 :(得分:0)
请查看您的应用是否有权读取外部存储设备,即Manifest.permission.READ_EXTERNAL_STORAGE
String photoPath = Environment.getExternalStorageDirectory() + "/abc.jpg";
Bitmap bitmap1 = BitmapFactory.decodeFile(photoPath);
imageView.setImageBitmap(bitmap1 );