list view population from data base items

A

AC Question

public List<Info> getInfo ()
{
List<Info> results = new ArrayList<Info>();

String selectQuery = "SELECT * FROM " + TABLE_INFO;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);

if (cursor.moveToFirst())
{
do
{
Info info = new Info(Integer.parseInt(cursor.getString(0)), cursor.getString(1), cursor.getString(2));
results.add(info);

} while (cursor.moveToNext());
}

db.close();
return results;
}

thats my code for populating the list view from my database

but the list view is empty, what more codes do i need to write, plz help
 

Trending Posts

Forum statistics

Threads
943,082
Messages
6,917,182
Members
3,158,813
Latest member
pierre5463