May I know what does integer “1” or other integer filled in this bracket in cursor.getString(1) means?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s the column index.
For example, if the query was
select a, b, c from ..., column index 1 would beb(being zero-based, the column indexes for that query are0 = a,1 = band2 = c).See here for more detail.
An alternative would be to use
cursor.getString (cursor.getColumnIndex ("b"))assuming you’re certain that column exists.