Help, people, well, I do not understand this topic at all. I take the data from the local database and use the cursor to scatter it in two ArrayList. (intValue is the value for the filter)
final Cursor cursor = mSqLiteDatabase.query("products", new String[] {DatabaseProductHelper.PRODUCT_NAME, DatabaseProductHelper.PRODUCT_COUNT, DatabaseProductHelper.PRODUCT_LIST, DatabaseProductHelper.PRODUCT_TYPE}, null, null, null, null, null) ; final ArrayList<String> arrTblNames = new ArrayList<String>(); final ArrayList<String> arrTblCounts = new ArrayList<String>(); if (cursor.moveToFirst()) { while ( !cursor.isAfterLast() ) { if(cursor.getInt(cursor.getColumnIndex("list"))==intValue) { arrTblNames.add(cursor.getString(cursor.getColumnIndex("name"))); arrTblCounts.add(cursor.getString(cursor.getColumnIndex("count")) + " " + cursor.getString(cursor.getColumnIndex("type"))); } cursor.moveToNext(); } Everything. Data in two ArrayList-ah. My task is to output data from the first to the left TextView, and from the second to the middle. I prepared the appropriate markup and I did it!
san = arrTblNames.toArray(new String[0]); myArrList = new ArrayList<HashMap<String, String>>(); HashMap<String, String> map; for(int a = 0; a<san.length; a++) { map = new HashMap<String, String>(); map.put("name", arrTblNames.get(a)); map.put("count", arrTblCounts.get(a)); myArrList.add(map); } SimpleAdapter adapter = new SimpleAdapter(this, myArrList, R.layout.row, new String[] { "name", "count" }, new int[] { R.id.name_product, R.id.count_product}); lv_products.setAdapter(adapter); Everything is fine, but ... HOW TO ADD A CheckBox? The checkbox should also work with the database.