android - order of ContentObserver notifications -


i'm querying contentprovider, looping thru rows in cursor, creating object each row , adding object list. i'm registering each object contentobserver of own uri. that's working fine, objects getting notified when db row updated and/or deleted. problem if db row deleted how know remove it's corresponding object list?

in object's onchange() method, i'm querying contentprovider it's _id , if no results back, i'm setting "deleted" flag. i've registered list (actually contentobserver wrapper around list) contentobserver main contentprovider uri, , in onchange() method, loop thru list , check "deleted" flag of each object in list , remove list if deleted==true.

however, seems list getting notified before individual objects are...hence, loop thru list relevant object's "deleted" flag not yet set.

is there way control order in contentobservers notified of changes? since docs don't anything, suspect answer "no", thought i'd ask.

the current situation isn't bad, since next time list gets notification, remove deleted object, hence, have @ 1 object in list...but there must "approved" way of handling this, i'm new android development haven't been able figure out be. suggestions?


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -