I have a cursor that receives all the data from my table after I use the Simcurscursoradapter to put it in a listview.
I wanted to know if with this same cursor I could get a data from a row and put it in a textview.
I have a cursor that receives all the data from my table after I use the Simcurscursoradapter to put it in a listview.
I wanted to know if with this same cursor I could get a data from a row and put it in a textview.
For each data type a table column saves the implementation of the Cursor interface a method to get its value.
To get the value stored in a column of type string, you must use the getString ( int column) .
These methods use an integer (index) to identify the column.
You can get this index through the column name using the getColumnIndexOrThrow (String columnName) .
So, to get the value stored in a column of type name string XXX you should use:
String valor = cursor.getString(cursor.getColumnIndexOrThrow("XXX"));