android.database.sqlite.SQLiteCursor@435b9ba0

后端 未结 2 1017
遇见更好的自我
遇见更好的自我 2021-01-18 13:27

I am getting the text \'android.database.sqlite.SQLiteCursor@435b9ba0\' returned from a spinner.getSelectedItem().toString() call. I\'m not sure why. The spinner is tied to

相关标签:
2条回答
  • 2021-01-18 14:06

    Your code is working as you wrote it. Spinner is an AdapterView. The adapter you connected it to is a SimpleCursorAdapter. This means that the selected item is a Cursor (positioned at the item in the Cursor's result set corresponding with the user's choice). Cursor has the default implementation of toString(), which returns something like android.database.sqlite.SQLiteCursor@435b9ba0.

    Since you didn't tell us what you are trying to do, it is impossible to accurately advise you further. Whatever it is you want to save, however, needs to be pulled out of the Cursor you get from getSelectedItem().

    0 讨论(0)
  • 2021-01-18 14:06

    i can be bothered reading your context, but just wanted to briefly help. i have a column named after DbHelper.KEY_COL, and i am retrieving a DbHelper.KEY_COL value at a specific row. perhaps some of my code would help:

    Cursor colCur=(Cursor)spCols.getSelectedItem();
    String col=colCur.getString(colCur.getColumnIndex(DbHelper.KEY_COL));
    
    0 讨论(0)
提交回复
热议问题