1

Key value pairs from sqlite to spinner

view story
linux-howto

http://stackoverflow.com – Could someone show me the correct way to achieve this. I have setup a hashmap from a sqlite query as follows public HashMap<String, String> getData(){ HashMap<String,String> user = new HashMap<String,String>(); String selectQuery = "SELECT * FROM " + TABLE_DEVICES; SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery(selectQuery, null); // Move to first row cursor.moveToFirst(); if(cursor.getCount() > 0){ user.put("device_name", cursor.getString(1)); user.put("id", cursor.getString(3)); } cu (HowTos)