Ok, so I think I figured that problem out (the database had somehow
reverted to a past version and didn't have the pass field - why that
happened it beyond me, but now the rawQuery seems to be working). The
question that I have now is, using rawQuery(), how to I reference the
output columns in the Cursor?
I tried using the names of the columns that I used in the select
statement, and that didn't seem to work. I also tried using
getColumnName(index) to access it, but that didn't work either. Any
thoughts?
mStatCursor = Main.mDbHelper.fetchStatsForPlayer(1);
startManagingCursor(mStatCursor);
String[] from = new String[] { mStatCursor.getColumnName(0) };
int[] to = new int[] { android.R.id.text1 };
ListAdapter stats = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_single_choice, mStatCursor, from,
to);
setListAdapter(stats);
Note: this code works if the query string is "SELECT * FROM action"
but not "SELECT pass FROM action"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---