How do I load and save ListView items to an SQLiteDatabase?

That's the wrong question, IMHO. The right question is: How do I get a ListView to reflect what is in my SQLiteDatabase? The first step is to use a Cursor and SimpleCursorAdapter rather than an ArrayList and an ArrayAdapter The second step is to do an insert() on the SQLiteDatabase when the user adds an entry, then requery() the Cursor to update the ListView Here is a sample project that demonstrates this Here is another.

That's the wrong question, IMHO. The right question is: How do I get a ListView to reflect what is in my SQLiteDatabase? The first step is to use a Cursor and SimpleCursorAdapter, rather than an ArrayList and an ArrayAdapter.

The second step is to do an insert() on the SQLiteDatabase when the user adds an entry, then requery() the Cursor to update the ListView. Here is a sample project that demonstrates this. Here is another.

Ok, I'll try it out. – Cg2916 Jan 23 at 23:27 I can't get the insert() right. – Cg2916 Jan 24 at 0:15 I also need the code for the Cursor – Cg2916 Jan 24 at 23:18.

ListView lv = (ListView) findViewById(android.R.id. Button button1main = (Button) findViewById(R.id. Final Dialog additem = new Dialog(ShoppingList.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions