خرید بک لینک

Vote count: 0

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);

asked 24 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 10 تير 1395 ساعت: 6:43

صفحه بندی