android.database.sqlite.SQLiteCursor@435b9ba0

后端 未结 2 1016
遇见更好的自我
遇见更好的自我 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().

提交回复
热议问题