I have a spier, pupulate with this way, i wish selected item; whith method spier.setSelection, which it is the best way to get the position of the item I require???
List<Map<String, String>> tablelist = new ArrayList<>();
SQLiteDatabase db = openOrCreateDatabase("database", MODE_PRIVATE, null);
String query = "select * from table";
Cursor ps = db.rawQuery(query, null);
while (ps.moveToNext()){
Map<String, String> datanum = new HashMap<>();
datanum.put("Id", ps.getString(ps.getColumnIndex("Id")));
datanum.put("Some", ps.getString(ps.getColumnIndex("Some")));
tablelist.add(datanum);
}
db.close();
ps.close();
SimpleAdapter spierAdapter = new SimpleAdapter(this, tablelist, R.layout.row_spier, new String[] {"Id", "Some"}, new int[] {android.R.id.text1, android.R.id.text1});
spierAdapter.notifyDataSetChanged();
spierAdapter.setDropDownViewResource(R.layout.row_spier_list);
spier.setAdapter(spierAdapter);
