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 8380525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:28:49+00:00 2026-06-09T16:28:49+00:00

I do some processing (quality improvement and a bit of resizing) on a Bitmap

  • 0

I do some processing (quality improvement and a bit of resizing) on a Bitmap object and then store it using bitmap.compress() function by giving a file name “myfile.png”.

newbitmap = processImage(bitmap);
FileOutputStream fos = context.openFileOutput("myfile.png", Context.MODE_PRIVATE);
newbitmap.compress(CompressFormat.PNG, 100, fos);

Now I want to load this image in an ImageView but I cant use setImageBitmap() to do that. Is there any alternative ?

The reason I cant use setImageBitmap() is that I am using RemoteViews for a widget, and using bitmap method leads to Failed Binder Transaction error when the image is large.

I tried to set image uri using the code below but the image does not load on the ImageView:

RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget_layout);

File internalFile = context.getFileStreamPath("myfile.png");
Uri internal = Uri.fromFile(internalFile);
rv.setImageViewUri(R.id.widgetImageView, internal);
updateAppWidget(awID, rv);

Thanks for your help!

  • 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-09T16:28:50+00:00Added an answer on June 9, 2026 at 4:28 pm

    While storing images in internal storage, you have to set the mode to MODE_WORLD_READABLE instead of MODE_PRIVATE. This is because a widget is handled by the home screen process and it cant access your files if you dont set the mode right.

    So replace this line:

    FileOutputStream fos = context.openFileOutput("myfile.png", Context.MODE_PRIVATE);
    

    with:

    FileOutputStream fos = context.openFileOutput("myfile.png", Context.MODE_WORLD_READABLE);
    

    Also, use Uri.parse() and getPath() instead of fromFile(). fromFile() works only on Android 2.2 and above.

    Uri internal = Uri.Parse(internalFile.getPath());
    

    Hope this helps!

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

Sidebar

Related Questions

I'm using OpenCV to do some processing on an AVI file. Everything is working
We would like to some processing in a Java application, store the results in
I have to do some processing on a file loaded by the user. This
My basic use case is do some processing, set flash[:notice] , and then redirect
I call from a spreadsheet module a function that does some processing in another
I have a C# function that does some processing and needs to return figures
I'm trying to do some image processing on iPhone. I'm using http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html to capture
I want to do some processing on each line of a file. for /f
I have a WCF 4 REST service which does some processing and then returns
I just started using resque to do some processing on some very large files

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.