Here is the code that shows you how to get an ArrayList request from a database.
public ArrayList<String> GetAllValues(String aTable,String[] aColumn) { ArrayList<String> list = new ArrayList<String>(); Cursor cursor = sqlDB.query(aTable, aColumn, null, null, null, null, null); if (cursor.moveToFirst()) { do { list.add(cursor.getString(0)); } while (cursor.moveToNext()); } if (cursor != null && !cursor.isClosed()) { cursor.close(); } return list; }
If you specify null in "aColumn", it will provide you with all the columns. Hope this helps.
source share