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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:32:23+00:00 2026-05-26T23:32:23+00:00

When i press load button, im suppose to go to the galley, choose a

  • 0

When i press load button, im suppose to go to the galley, choose a picture and then set the imageview img to that picture. The problem is after i choose a picture in galley, the imageview does not update. However, if i press load button a second time, it take a second or two to load the galley and in that time, imageview will load the picture i previously choosen. Can someone help me so i can get imageview to refresh correctly

 load.setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View arg0) {        
              Intent intent = new Intent();
                intent.setType("image/*");
                intent.setAction(Intent.ACTION_GET_CONTENT);
                startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_PICTURE);
                try {

                    FileInputStream in = new FileInputStream(selectedImagePath);
                     bMap = BitmapFactory.decodeStream(in);
                     img.setImageBitmap(bMap);
                     if (in != null) {
                         in.close();
                     }
                     img.invalidate();

                } catch (Exception e) {}
            }      
 });
  • 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-05-26T23:32:24+00:00Added an answer on May 26, 2026 at 11:32 pm

    Well, this doesn’t work this way 🙂
    You should move your code for loading and setting the bitmap to the onActivityResult method. Also it’s a very bad practive to catch an instance of Exception – try catching only the respective checked exception here – i.e FileNotFoundException or something -you can delete your try – catch clasuse and afterwards pres ctrl + 1 in Eclipse while you have selected the FileInputStream in = new ... row –> choose the surround with try-catch option and eclipse will auto-generate for you the appropriate catch clause( and here I mean just the proper checked exception to be handled, not the catch clause body 🙂 ).

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

Sidebar

Related Questions

I press button after that appears div in which shows loading and loads iframe.
Facebook sdk script does not load when I press on IE7 refresh button, but
I have an activity that lets the user load some data when they press
In my program I will press a button, and it will load form2. I
I have a UIViewController that I load every time I click a button: NearMe
i have a glsurfaceview renderer with some code that allows me resume after press
When I press Load Url button on my Activity, it starts a new browser
I want the user to press a button, where AJAX load will load Google
Look at this page . Press the orange -> button and then the <-
I am using an iFrame to load http://www.amazon.co.uk when i press Amazon UK button

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.