ContentProviders are somewhat more abstract than SQL...

You could have a special URI that means "increment this item's view count",
e.g.:

authority/item/# - for operations on the entire item

authority/item/#/viewcount - updating would increment the view count by one

It might also be possible with a batch operation, but I haven't used those
and can't say if there is support for an "N+1" type backreference.
16.04.2011 20:59 пользователь "Paul" <[email protected]> написал:
> I have an app that as the user opens 'things' from the ListView, I
> want to update their view count as they are opened. Currently doing
> this via raw SQL (...SET views = views + 1...), but would like to run
> this operation through my content provider's 'update' method, if
> possible.
>
> Does anyone now if it's possible to pass in increment values via
> the .update() method's ContentValues parameter without having to first
> run a query to find out the current (in my case, view) value?
>
> Thanks for any pointers,
>
> Paul
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" 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-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to