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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:50:22+00:00 2026-05-25T01:50:22+00:00

Background: I’m filling gridview with imageviews using baseadapter. Imageview’s resources are downloaded using AsyncTask.

  • 0

Background:
I’m filling gridview with imageviews using baseadapter. Imageview’s resources are downloaded using AsyncTask. I get a callback from onPostExecute method as success or failure. And I use this callback in adapter’s getView method.

Problem
If url for imageview returns 404 error, gridview has some empty spaces because of 404 error. I can remove those items and call notifydatasetchanged, but this time it refreshes all gridview from the start. Although i keep errored items in somewhere, remove them and call notifydatasetchanged once for all, it seems gridview is filled twice in application.

Question
I want to load images in gridview without any gaps. For instance if there are 9 images and forth and sixth images return 404 error, then i want to see only seven items in gridview

I hope my question is clear. 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-05-25T01:50:22+00:00Added an answer on May 25, 2026 at 1:50 am

    I solved my problem like this. When i catch a callback from 404 error, in baseadapter getview method,

    DownloadCallback dc = new DownloadCallback(){
    
           public void onSuccess(String downloadedString){
    
           }
    
           public void onFailure(int callbackID){
              System.out.println("onFailure - " + callbackID);
    
              if( callbackID < getCount()) // in case of out of index exception
                 rows.remove(callbackID); 
              //parent.removeViewAt(callbackID); we cannot remove it is UNSUPPORTED
              reloadFromPosition(callbackID, imageView, parent);
            }
         };
    

    and reloadFromPosition method is like that;

    private void reloadFromPosition(int position, View convertView, ViewGroup parent)
    {
        if( position < getCount())
        {
            System.out.println("reloadFrom - if - " + position);
            getView(position, convertView, parent);
            reloadFromPosition(position + 1, parent.getChildAt(position +1), parent);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: At my company we are developing a bunch applications that are using the
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background: I've wrote a small library that is able to create asp.net controls from
BACKGROUND I am automating an PowerPoint 2007 via C# I am writing unittests using
Background: I am using Eclipse to develop an Android app. I have an xml
Background I first wanted to upload a file via json and get a response
Background: I'm in the process of creating a web service using ASP.NET 2.0. This
Background: One of the problems with using a local static variable in a function
Background: I want to check-out the source code from Cliche , which is stored
BACKGROUND: Co-worker Adam has been using Google refine to process database downloads with much

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.