How to insert a string into a ListView adapter?
Cursor getPositions() { return mDB.rawQuery("SELECT * FROM "+ TABLE + " WHERE _id = 0", null); } At the output in the ListView is only the first value. The cycle works, as I understand the problem in the adapter, which apparently is not intended to write the row as a column in the ListView ?
cursor = DB.getPositions(); String[] from = new String[cursor.getColumnCount()]; // создаём массив, размерность которого равна количеству столбцов. for (int i = 0; i < cursor.getColumnCount(); i++) { from [i] = "P" + i; // в массив заносим названия столбцов, получается P1, P2, P3 и т.д. } scAdapter = new SimpleCursorAdapter(getActivity(), R.layout.simple_item, cursor, from, new int[] {android.R.id.text1}, 0); //объявляем адаптер и вносим туда известные нам названия столбцов. listview.setAdapter(scAdapter);