android - How can I check if a ContentResolver is busy -



android - How can I check if a ContentResolver is busy -

i have button , when user clicks button, should update status of info specified id

public void updatebyclick(int id) { mycursor.movetoposition(id); if (mycursor.getshort(mycursor.getcolumnindex(mytable.status)) == 0) { contentvalues cv = new contentvalues(); cv.put(mytable.status, true); getcontext().getcontentresolver().update(mytable.content_uri, cv, mytable._id + "= ?", new string[] {string.valueof(id + 1)}); } }

the problem is, if user clicks button fast (so there lot of updatebyclick events) update operation calls many times (update isnt happened yet, status still == 0)

how can check if contentresolver (or else) busy (currently updating) can prevent multiple update calls

i solve timestamps. every time update method called create timestamp system.currenttimemillis() , check difference lastly saved timestamp. if doesn't reach threshold don't phone call update request.

android android-contentprovider android-cursor

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -