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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:44:41+00:00 2026-06-18T12:44:41+00:00

I’m using the nostra13 UniversalImageLoader to load a bunch of images into a gridview

  • 0

I’m using the nostra13 UniversalImageLoader to load a bunch of images into a gridview and its working beautifully, but when a user clicks an item on my menu, i need the images to change (not open a new page, but reload/refresh the images on the same page)

I’m calling the imageloader like so:

protected ImageLoader imageLoader;

imageLoader = ImageLoader.getInstance();
imageLoader.init(ImageLoaderConfiguration.createDefault(this));

Bundle bundle = getIntent().getExtras();

imageUrls = bundle.getStringArray(Extra.IMAGES);

options = new DisplayImageOptions.Builder()
    .showStubImage(R.drawable.stub_image)
    .showImageForEmptyUri(R.drawable.image_for_empty_url)
    .cacheInMemory()
    .cacheOnDisc()
    .bitmapConfig(Bitmap.Config.RGB_565)
    .build();

final GridView main_gridview = (GridView)findViewById(R.id.main_gridview);
main_gridview.setAdapter(new ImageAdapter());

public class ImageAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return imageUrls.length;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final ImageView imageView;
            if (convertView == null) {
                imageView = (ImageView) getLayoutInflater().inflate(R.layout.item_grid_image, parent, false);
            } else {
                imageView = (ImageView) convertView;
            }

            imageLoader.displayImage(imageUrls[position], imageView, options);

            return imageView;
        }
    }

So as you can see the Extras.IMAGES is the string array containing the various URLs, so when a user clicks said button on the menu, I have the array containing the new URLS, but am not sure how to ‘refresh’ the image adapter?

I understand you can ‘add’ pictures to the gridview on the fly, but I didnt see in nostra’s documentation if you could completely refresh the whole array..

Any help is greatly appreciated. 🙂

PS. Sorry if the answer to this is obvious I’m only about a week into android dev.

  • 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-18T12:44:42+00:00Added an answer on June 18, 2026 at 12:44 pm

    I solved it. Just set ImageUrls to my string array of updated images, then I declared the ImageAdapter object at the top and called notifyDataSetChanged() on that object like so:

    ImageAdapter imgAdapter;
    
    main_gridview.setAdapter(imgAdapter);
    
    imgAdapter.notifyDataSetChanged();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JSon response to parse title,date content and thumbnail images and place
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
I am using jsonparser to parse data and images obtained from json response. When
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
this is what i have right now Drawing an RSS feed into the php,

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.