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
• 9,680 points
3,902 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,660 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,380 points
4,605 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
910 views
0 votes
1 answer

How to get columns from Excel files using Apache POI?

The only way to see all the ...READ MORE

answered Oct 18 in Others by narikkadan
• 37,660 points
299 views
0 votes
1 answer

How to find out how many rows and columns to read from an Excel file with PHPExcel?

Solution: $file_name = htmlentities($_POST['file_name']); $sheet_name = htmlentities($_POST['sheet_name']); $number_of_columns = htmlentities($_POST['number_of_columns']); $number_of_rows ...READ MORE

answered Oct 23 in Others by narikkadan
• 37,660 points
306 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,480 points
64 views
0 votes
1 answer

Android backgroud image slow the app

You're mainly noticing the latency because you ...READ MORE

answered Nov 10 in Android by Edureka
• 10,880 points
32 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
3,027 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,100 points
1,657 views
0 votes
1 answer

How to get landmarks from current location using google map in iphone?

You can achieve this by saving several ...READ MORE

answered Sep 20 in Others by Aditya
• 7,660 points
57 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,660 points
709 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP