How to get Bitmap from an Uri

0 votes

How to get a Bitmap object from an Uri if I succeed in storing it in /data/data/MYFOLDER/myimage.png or file///data/data/MYFOLDER/myimage.png to use it in my application? Does anyone have an idea on how to accomplish this?

Feb 18 in Others by Rahul
• 8,980 points
575 views

1 answer to this question.

0 votes
Try using the following lines of code in order to use this in your application:-

try 
{ 
Bitmap bitmap = MediaStore.Images.Media.getBitmap(c.getContentResolver() , Uri.parse(paths)); } 
catch (Exception e) 
{ 
//handle exception 
}

Also additionally, yes path must be in a format of like this:-

file:///mnt/sdcard/filename.jpg

answered Feb 18 by Aditya
• 7,280 points

Related Questions In Others

0 votes
1 answer

How to launch an emulators from Flutter?

Hi@akhtar, Before launching emulators you should check if ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,360 points
4,072 views
0 votes
0 answers

How to get response from S3 getObject in Node.js?

I am attempting to get data back ...READ MORE

Apr 23 in Others by Kichu
• 19,040 points
189 views
0 votes
2 answers

How to get the URL of the current tab in Google Chrome?

Its so simple.... If you want to ...READ MORE

answered Aug 12, 2020 in Others by Steve
• 200 points
721 views
0 votes
0 answers

How to handle large http response data from observer in Angular application to avoid browser crash?

Suppose we have a angular application which ...READ MORE

Apr 19, 2019 in Others by Hemant Gajbe
1,518 views
0 votes
1 answer

Android backgroud image slow the app

You should have diferentiate sizes for deferent ...READ MORE

answered Jun 16 in Others by polo
• 1,500 points
11 views
0 votes
1 answer

Running docker on Android

According to the documentation, the Android kernel is ...READ MORE

answered Aug 1, 2018 in Docker by Kalgi
• 52,350 points
2,960 views
0 votes
1 answer

Task Canceled Exception while invoking AWS Lambda

I'm guessing either the TaskCanceledException instance is ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 58,080 points
1,516 views
0 votes
1 answer

Is there a way to run Python on Android?

YES! An example via Matt Cutts via SL4A -- "here’s ...READ MORE

answered Sep 19, 2018 in Python by Priyaj
• 58,080 points
391 views
0 votes
1 answer

How to create an HTML button that acts like a link

To answer your doubt, the plain HTML ...READ MORE

answered Feb 17 in Others by Aditya
• 7,280 points
93 views
0 votes
1 answer

how to get last insert id after insert query in codeigniter active record

To answer your doubt, try the following ...READ MORE

answered Feb 23 in Others by Aditya
• 7,280 points
256 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP