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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:55:16+00:00 2026-06-01T14:55:16+00:00

I need to make a ListAdapter that presents data from multiple ContentProviders. The ContentProviders

  • 0

I need to make a ListAdapter that presents data from multiple ContentProviders. The ContentProviders themselves represent one table each from relational database.

I want to use the CursorLoader system to retrieve aggregate data into ListView. Is this possible to do with 1 loader or do I need to use multiple loaders? I’d prefer to use one.

I’m not sure how I can have 2 ContentProviders interact with each other beyond doing the join manually in code which doesn’t seem like a great option either.

  • 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-01T14:55:17+00:00Added an answer on June 1, 2026 at 2:55 pm

    You will have to write a Custom Loader class. For example:

    public class FooLoader extends AsyncTaskLoader {
    
        Context context;
    
        public FooLoader(Context context) {
            super(context);
            this.context = context;
        }
    
        @Override
        public Cursor loadInBackground() {
            Log.d(TAG, "loadInBackground");
            YourDatabase dbHelper = new YourDataBase(context);
            SQLiteDatabase db= dbHelper.getReadableDatabase();
    
            /*** create a custom cursor whether it is join of multiple tables or complex query**/
            Cursor cursor = db.query(<TableName>, null,null, null, null, null, null, null);
            return cursor; 
        }
    }
    

    In the calling activity or fragments onCreate() method, you would need to call the custom loader class:

    public class MyFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            Log.d(TAG, "onCreate():" + mContent);
            Loader loader = getLoaderManager().initLoader(0, null, this);
            loader.forceLoad();
        }   
    
        @Override
        public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
            Log.d(TAG, "onCreateLoader()")  ;
            return new FooLoader(getActivity());
        }
    
        @Override
        public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
            Log.d(TAG, "onLoadFinished");            
        }
    
        @Override
        public void onLoaderReset(Loader<Cursor> cursorLoader) {   
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make sure that user can run only one instance of my
I need to make a div layer so that when you click on it
I need to make a column unique in one of our database tables, and
I need to make a proxy script that can access a page hidden behind
I need to make a stored procedure or function that returns a set of
I need make my method capable of accepting JSON data. Say I need to
Need to make a function that would open a popout with a div inheriting
I need to make a few tweaks to only the following elements from jquery.ui.autocomplete.css
I need make layout that must look exactly like below 2 sites. How should
I need to make application that will catch EVERY SINGLE SMS that phone receives,

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.