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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:47:34+00:00 2026-05-23T18:47:34+00:00

I am trying to write a simple app just to display on screen the

  • 0

I am trying to write a simple app just to display on screen the results on a sql query.

public class ContactLookup extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         Cursor c = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, 
                null, null, null, null
                );
    }
}

How exactly do I print the results of the cursor? Everything I find goes into to way more detail then I need at the moment… I just want to know how to get that variable printed on screen.

  • 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-23T18:47:35+00:00Added an answer on May 23, 2026 at 6:47 pm

    You’ll need to have something that shows text (or whatever you get from your DB). Most likely this will be a simple TextView (you can do this in the XML-Layout or in Java-Code).

    If you declared your TextView in the XML-Layout, then you’ll need to find the TextView in order to set it’s text.

    After that, you’ll want to move the Cursor to the first set of data in it so you can read your results from it.

    After that, you can simply use the Cursor’s getXX()-methods to get your values form the result-set.

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

Sidebar

Related Questions

I'm trying to write a very simple app that will do just one very
I'm trying to write really simple iOS5 app just searching for specific type of
I'm new to cakephp and trying to write a simple app with it, however
I'm trying to write a simple WPF app that has two ellipses, joined by
I'm trying to write a simple program in VC++ which will just initialize the
I'm trying to write a really simple GUI app for inserting some records into
I am trying to get an ASP.Net MVC2 app to display a simple custom
I'm trying to write a simple Compact Framework winforms app. The main form has
I am trying to write a console app that simply lists the number of
I am trying to write simple Visual Studio Add-In for code generation. In my

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.