Take the 2-minute tour ×

Is it possible to feed rows in a tablelayout from cursors? If yes, how?

My cursor.

cursor = db.rawQuery("SELECT _id, countryName , capitalName FROM country WHERE countryName LIKE ?",new String[] { "%" });
adapter = new SimpleCursorAdapter(this, R.layout.capital_list_item,cursor, new String[] { "countryName" , "capitalName"},new int[] { R.id.countryName, R.id.capitalName });
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Shortly and sweetly, No.. You can't use Cursor Adapter in TableLayout

You can use Cursor Adapter only in ListView, Spinner and GridView...

share|improve this answer
basically all subclasses of AdapterView –  njzk2 Dec 6 '11 at 10:51
thanks, I'll look into gridview. –  Binoy Babu Dec 6 '11 at 10:53
add comment

Your Answer


