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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:30+00:00 2026-06-16T00:20:30+00:00

I have problems using CursorLoader . I need to retrieve phone and email adress

  • 0

I have problems using CursorLoader. I need to retrieve phone and email adress for given name.

I implemented methods of LoaderManager.LoaderCallbacks<Cursor> interface. The problem is that I need to get contact_id from table contacts first, and then based on that contact_id I need to query RawContacts/Data table for email and phone.

I can’t find example where you have more than one query in onCreateLoader(), usually you have return new CursorLoader(...). I have idea of using managedQuery(..) method to get id of contact and pass it to CursorLoader but I guess this isn’t good idea. Any suggestion?

  • 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-16T00:20:31+00:00Added an answer on June 16, 2026 at 12:20 am

    In the OnCreateLoader, there is an id parameter which you can use to change the CursorLoader.

    You can do something like

    onCreateLoader(int id, bundle args) {
    
        switch(id) {
    
            case FETCH_CONTACT_ID: {
                 //Return CursorLoader for fetching contactID
                 break;
            }
    
            case FETCH_CONTACT_INFO: {
                 //Return CursorLoader for fetching raw contacts
                 break;
            }
       }
    }
    
    OnLoadFinished(Loader loader, Cursor c) {
    
        switch(loader.getId()) {
    
         case FETCH_CONTACT_ID: {
             //Contact IDs have been fetched, so start fetching raw contact data
             //Enter the IDs you want to fetch data for in the bundle which will be passed to onCreateLoader()
             mLoaderManager().restartLoader(FETCH_CONTACT_INFO, args);
             break;
        }
    
        case FETCH_CONTACT_INFO: {
             //Raw contact info has been fetched, do whatever you want with it
             break;
        }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problems with using the OPTIONAL phrase in the SPARQL statements. When I'm
Have you any problems using it on high concurrency environment? It's really works as
I am learning Java with Swing and I have some problems with using JTextField
I have problems with running CAS using the proxy mode. However, I don't have
I'm having some problems using cascade operations on hibernate. I have one entity (TripleDBmodel),
i deserialize a widget-hierarchy using gson, but have problems deserializing final fields. Example: public
I'm using devexpress and i have two problems. My insert stored procedure work fine.
I have some problems sending mails through SMTP using Spring's MailSender interface and the
I have some problems to start programming using cocos2D on linux + android. I
The post summarizes problems in using Screen in Mac's terminal when you have the

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.