Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:58:21+00:00 2026-06-09T12:58:21+00:00

I am opening the gallery and getting the path of an image when it

  • 0

I am opening the gallery and getting the path of an image when it is selected. Then I create a Bitmap from this path and store this bitmap in internal storage through bitmap.compress() function. Is it possible to display this image in ImageView by specifying the path of this stored bitmap in setImageUri() function of ImageView ?

Bitmap bmap = BitmapFactory.decodeFile(selectedImagePath);
FileOutputStream fos = context.openFileOutput(fileName, Context.MODE_PRIVATE);
bmap.compress(CompressFormat.PNG, 100, fos);
fos.close();

Here, fileName is an integer (actually an ID for a widget) converted into String.

Would it be possible to load this image in ImageView like this:

File internalFile = getFileStreamPath(fileName);
Uri internal = Uri.fromFile(internalFile);
imageView.setImageUri(internal);

I know I can set the image using setImageBitmap() function but that would require me to read the Bitmap from the file and pass it through the Parcel object which leads to Failed Binder Transaction error when the images are large. I am making a widget which displays an image through ImageView.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:58:22+00:00Added an answer on June 9, 2026 at 12:58 pm

    The setImageUri() method is not intended to be used that way, see this question and answers. The best way seems to be scaling the bitmap to the view before calling setImageBitmap(), e.g. by using Bitmap.createBitmap() with a Matrix parameter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm opening an image from the gallery, resizing it, and attempting to save the
I need help about URL rewriting for image gallery for site. This is problem,
This is killing me! I'm using django-filebrowser, and I want to create a gallery
I am trying to attach an image that is picked from the image gallery
I have to create an image gallery where user can select some images and
I've used the Backbox Image Viewer from http://www.javascriptkit.com/script/script2/backbox/ on this website for over 3
Opening an application( probably an .exe file) as an administrator in headless mode from
Im opening a map like this: NSString *urlString = [NSString stringWithFormat:@http://maps.google.com/maps?q=%@,%@, destLat, destLong]; [[UIApplication
i am opening jQuery Dialog through the below code.The problem here is when i
I am trying to figure why I am getting this error. **Warning: require_once(\C\wamp\www\PHP with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.