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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:45:08+00:00 2026-06-12T06:45:08+00:00

I am using a very simple CursorLoader with an ImageDownloader. The ImageDownloader is running

  • 0

I am using a very simple CursorLoader with an ImageDownloader. The ImageDownloader is running and everything but the CursorLoader finishes, and THEN the ImageDownloader begins its job of downloading the images, but the GridView is not updating with the downloaded images..

Within my ListFragment I have the following onActivityCreated method:

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    Log.d(TAG, "onActivityCreated");

    super.onActivityCreated(savedInstanceState);

    cursorAdapter = new OURSVPImageAdapter(getActivity(), null);

    // set the adapter on the gridview
    mGridView.setAdapter(cursorAdapter);

    // load the data
    getActivity().getSupportLoaderManager().initLoader(2, null, this);
}

My CursorLoader is as follows:

public static final class PhotoCursorLoader extends SimpleCursorLoader {

    Context mContext;

    public PhotoCursorLoader(Context context) {
        super(context);

        Log.d("PhotoCursorLoader", "Constructor");

        mContext = context;
    }

    @Override
    public Cursor loadInBackground() {
        Log.d("PhotoCursorLoader", "loadInBackground");

        PhotosDataSource datasource = new PhotosDataSource(mContext);

        # STEP 1
        return datasource.getAllPhotos(((EventActivity) mContext).getEventId());
    }

}

The line labeled # STEP 1 that retrieves all of the photos is just a method that retrieves a Cursor, as seen here:

public Cursor getAllPhotos(long event_id) {
    Log.d(TAG, "getAllPhotos");

    Cursor mCursor = getWritableDatabase().query(true, TABLE_NAME, COLUMNS_PHOTOS, DatabaseConstants.KEY_EVENT_ID + "=" + event_id, 
            null, null, null, null, null);

    return mCursor; 
}

So, this being the CursorLoader for the ListFragment, it assumes its complete when that Cursor is returned, which is correct. From my understanding the setAdapter() method is what would actually trigger the getView method.

The Trouble I’m having is that Everything seems to be running fine, my log output is outputting the urls for the images correctly, breakpoints all showing legit data, the issue though, is that my grid view never gets updated with the images that the ImageDownloader retrieves.

EDIT
This is the SimpleCursorLoader I’m using: https://gist.github.com/1217628

  • 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-12T06:45:09+00:00Added an answer on June 12, 2026 at 6:45 am

    As with another of my questions.. the refresh shouldn’t be forced, and when using a provider you can have the provider notify the contentresovler of updates. I have a method that inserts new photos, and that method uses the data provider. The data provider needed to

    getContext().getContentResolver().notifyChange(uri, null);
    

    to actually update the Cursor.

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

Sidebar

Related Questions

Very simple question, but I want to start using a consistent naming convention for
I am changing the paragraph text using a very simple jquery , but it
Hopefully a very simple question. But I'm using Code First with an MVC app
I'm using a very simple jQuery live preview method which works brilliantly. But how
Using Access Database (*.mdb or *.accdb) is very simple. But I wonder about performance
this is probably very simple using javascript or jquery, but I cannot wrap my
I am using a very simple structure, mapping, as defined below: struct mapping{ int
I'm using a very simple Stylesheet Switch by php. It was fine all along
I am using flask , and trying to do something very simple using the
riting a very simple search using like and have an option to omit options,

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.