tags:

views:

98

answers:

2
+1  A: 

You cannot modify an existing Cursor this way. You need to create the Cursor with the data you seek at the outset.

More likely, though, you do not need to modify the Cursor, but rather whatever is using the Cursor has to be smarter. For example, if your issue is that you cannot use a computed column in SimpleCursorAdapter, you need to switch to CursorAdapter and override bindView() to have the smarts you want.

CommonsWare
Unfortunately this suffers the same problem my previous extension of SimpleCursorAdapter had. I cannot control the fact that bindView (or my previous ways getView) is called multiple times per row, which results in alot of lost time querying the RingtoneManager several times for the same data. I want to query only ONCE.. is there another way I am missing to map the values?
Ryan
Cache the value in the row via setTag(). You can use the same techniques as I advise for caching findViewById() lookups, in this free excerpt from one of my books: http://commonsware.com/Android/excerpt.pdf
CommonsWare
i cannot seem to find out how setTag and getTag can be realted to a specific row (only layouts, ids, etc).. could you provide an example of this?
Ryan
Yeah, in reading your follow-up question, I realized that my answer was incorrect.
CommonsWare
A: 

please take a look at this thread:

Writing to cursor:

blacharnia