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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:11:12+00:00 2026-05-31T16:11:12+00:00

I was wondering : I’m trying to make an app that as a Listview,

  • 0

I was wondering : I’m trying to make an app that as a Listview, displaying data from a database.

Here is the specific thing : I want that on a event that modified the database, the listview is automatically updated, as if there was a “listenner” on the database that … well automatically upload the listview.

From what I read, I should use a loadManager, a cursor, fragment (to allows me to use loadManager for anterior versions of 3.0) … but as I’m a beginner, it’s kind of hard to me to understand.

I was wondering if someone could just try to explain me deeply how to use those tools together (I’m not asking for code, just explanation 🙂 )

Thanks !

EDIT : Ok as I’m new and I’m very lost, I need some more explanation.

The Different steps are :
1) Activity create a listView, a custom CursorAdapter and a cursor, on the onCreate(). Then still on onCreate, it feed the cursor with a standart request on SQLiteDatabase object. Then we affect the cursor to the adapter, and the adapter to the listView.

2) When an insert event comes, I use an insert function of SQLiteDatabase and then get the result of the request on a cursor, and give it to the CursorAdapter of the list (will it automatically update the listview ?)

3) For my customAdapter well … The more I read sources, examples and tutorial, the more I get lost. Just understood that I have to override bindView() and newView(), I didn’t really get their purposes, plus the way I want to create many data type for my adapter…

I feel like I’m not really smart, but I really tried and I’m still lost 🙁

  • 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-31T16:11:13+00:00Added an answer on May 31, 2026 at 4:11 pm

    If you use a CursorAdapter on your ListView, that’s all done for you! http://developer.android.com/reference/android/widget/CursorAdapter.html

    Edit: Sorry, I should explain more. I read it quick and I was thinking you had the ListView already and wanted to keep it updated.

    When you get your data from the database, whether through ContentResolver.query, or SQLiteDatabase.query, or something else, you will get a Cursor back. You need to use this in a CursorAdapter.

    You need to subclass CursorAdapter and override bindView to use the data from the cursor inside the ListView (since it doesn’t know what columns you have and what field maps to what view). Assuming you use the FLAG_REGISTER_CONTENT_OBSERVER flag when creating the CursorAdapter, every time the data in your cursor gets updated the list should update.

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

Sidebar

Related Questions

Wondering if anyone has gotten the infamous database is locked error from Trac and
Wondering if there is any way to get the lambda expressions that result from
Wondering if anyone has a good solution for this. My app is displaying nothing
Wondering if it's possible to process HAML from database entries. My model currently processes
wondering if there's any way to make it so that a list I have
Wondering what is the best or most popular database client tool. Similar to Microsoft's
Wondering if it's possible to change a value returned from a queryset before sending
Wondering if anyone can help me. I'm trying to put together a weekly photo
Wondering if it is possible to have a version control of a MySQL database.
Wondering what the best way to make this more efficient, perhaps with jQuery. I

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.