Arash.Ch Arash.Ch - 4 months ago 48
Android Question

Get the value from the cursor in Android SQLite

I used the below code to get the "place" value from the "place" column using a cursor. The value of the place in my database is a string, but It returns a number that I have know idea what it is.

Thanks in advance

here's my code:



I think I've inserted them correctly... here it is:


R.string.consert7_place is an integer, not a String.

You need to use getResources().getString(R.string.consert7_place)

For more details, see Android: How do I get string from resources using its name?

Your cursor.getString usage is fine.