Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Use of differents tools
    text
    copied!<p>I was wondering : I'm trying to make an app that as a Listview, displaying data from a database.</p> <p>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.</p> <p>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.</p> <p>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 :) )</p> <p>Thanks !</p> <p>EDIT : Ok as I'm new and I'm very lost, I need some more explanation.</p> <p>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.</p> <p>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 ?)</p> <p>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...</p> <p>I feel like I'm not really smart, but I really tried and I'm still lost :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload