last day (14 days later) » 

6:55 AM
0
A: reading image file from internal storage path in android

AmsheerYou can achieve this by using the simple method Bitmap bitmap = BitmapFactory.decodeFile(filePath); mImageView.setImageBitmap(bitmap); Some of the times BitmapFactory.decodeFile(filePath) will create OutOFMEmory error you need to handle that.

 
GPW
I tried this method still the value of bitmap object is null
 
Ok did you check this catVo.getImage_path()? Print this path in log.
 
GPW
yes the path is : /data/data/mypackagename/files/foldername/Images/MDSs2LJgLP.png
 
Check one by one . First check this MDSs2LJgLP.png is existing or not.
 
GPW
I checked it exists.
 
6:55 AM
Do you have read permission, write permission ex. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> in your AndroidManifest?
 
GPW
yes the permission is there but I am reading from internal storage
Hi
 
Another one possible is ImageView maybe null? Your bitmap is alright but suppose you forgot to initiate ImageView. Can you check that. I am not sure but check this
 
GPW
Imagview is not null
the bitmap itself i am getting null
 
Are you sure?
 
GPW
yes i dubug the bode
code
the image path which i told you i got
while doing Bitmap bitmap = BitmapFactory.decodeFile(catVo.getImage_path(), options);
 
6:58 AM
Remove this getRoundedBitmap and try again.
 
GPW
here the bitmap itself is null
is there something to do with tht path
is there something to do with pat
?
 
Where is this option come from simply try this. Bitmap bitmap = BitmapFactory.decodeFile(filePath);
 
GPW
i tried this not working
 
i already face this issue but when i add read and write permission it worked for me.
Is your image size is big?
 
GPW
any other way you can suggest me to read the image
except pathname
not so big
 
7:03 AM
Can you try with some other path. I mean some other image. This code must work. Nothing related with this.
 
GPW
I am downloading and storing the images in internal storage
tht checking if the the path exist
showing it
for every image it is not displaying t
 
No i just want to find the issue. use any of your image that is taken from your device and try.
 
GPW
ok stored in internal memory right
?
 
Whatever internal or external.
 
GPW
ok
give me some time
 
 
2 hours later…
GPW
9:21 AM
dr
?
 
Did you find the issue?
 

last day (14 days later) »