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

  • Home
  • SEARCH
  • 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 6838805
In Process

The Archive Base Latest Questions

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

I am trying to refresh a GalleryView with new items by adding the items

  • 0

I am trying to refresh a GalleryView with new items by adding the items to the Adapter and doing the following inside the handler which is called from inside doInBackground method of AsyncTask.

private final Handler handler = new Handler() {
    public void handleMessage(Message msg) {
        if(msg.arg1 == 1){

            gaAdapter.notifyDataSetChanged();
            ga.setAdapter(gaAdapter);
            ga.setSelection(midposition);
        }
    }   
};

The GalleryView seems to respond to the above code but does not automatically refresh itself. The items are updated only when it is horizontally scrolled. How can I do this automatically?

  • 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:38:29+00:00Added an answer on May 26, 2026 at 11:38 pm

    notifyDataChanged() need to be involved on UI thread, try this:

    runOnUiThread(new Runnable() {
      public void run() {
        gaAdapter.add(newListItem);
        gaAdapter.notifyDataSetChanged();
        ga.setSelection(midposition);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to refresh a page without sending POST from the previous time. I've
I am trying to refresh a UITableView with new cells every 30 seconds. My
I'm trying to get a page to refresh when navigated to from the back
I'm trying to refresh a div from Javascript at each loop and see 1,
I'm trying to get a Winforms combobox to automatically refresh when new rows are
I'm trying to implement returning from an Activity without needing to refresh the screen.
im trying to grab search items from twitter via PHP curl, process and update
I am trying to get the following code to fire once on page load/refresh
I'm trying to refresh a div with jquery that loads the time which is
i am trying to Refresh() a panel which uses the wx.ColourDialog. Once I refresh

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.