I'm trying to create a Bitmap or Drawable from existing file path.
String path = intent.getStringExtra("FilePath");
BitmapFactory.Options option = new BitmapFactory.Options();
option.inPreferredConfig = Bitmap.Config.ARGB_8888;
mImg.setImageBitmap(BitmapFactory.decodeFile(path));
// mImg.setImageBitmap(BitmapFactory.decodeFile(path, option));
// mImg.setImageDrawable(Drawable.createFromPath(path));
mImg.setVisibility(View.VISIBLE);
mText.setText(path);
But setImageBitmap()
, setImageDrawable()
doesn't show an image from the path. I've printed path with mText
and it looks like : /storage/sdcard0/DCIM/100LGDSC/CAM00001.jpg
What am i doing wrong? Anyone can help me?
id
inmBuffer
. But itsmHeight
,mWidth
value is-1
, andmLayoutBounds
isnull
. – CavettoCursor
and tried other images, but same result. Also, i checked the path viaadb shell
and found out images are exists in that path. – Cavetto