I got a result from remote database as a Result set like this:
String queryString = "select n as name, a as address from sometable";
ResultSet rs = st.executeQuery(queryString);
I want to show in a ListView some data: a name, an address from this result and a checkbox for user to check some lines. The lines checked will be saved in a local dadabase (SQLite) to work with further.
Please, help me to find an answer to these:
How should I use ResultSet to show in ListView, I read that to use a SimpleCursorAdapter I should have a Cusor, not a ResultSet. How can I convert ResultSet into Cursor?
And another question. Do I need to have 1 extra field for checkbox (for example “ch_”)? If user press an item in a list, do it change the value in “ch_”?
Thank you in advance.
you could convert your
ResultSetintoArrayListof your customized object, then instead of usingSimpleCursorAdapter, you could extend fromBaseAdapterto utilize the list data.