android - Why can't I delete using a getContentResolver..? -


i can data no problem...but cannot delete data. suggestions..??

                cursor cu = getcontentresolver().query(content_uri, null, null, null, null);             if (cu.movetofirst())             {                 numberindb = cu.getstring(2);                 system.out.println("number in db = " + numberindb);             }              contentresolver c = getcontentresolver(); 

neither of these next 2 lines work

            c.delete(content_uri, "title ="+ numberindb, null);             getcontentresolver().delete(content_uri, "title ="+ numberindb, null); 

if title string, suspect need quote in query:

getcontentresolver().delete(content_uri, "title ='" + numberindb + "'", null) 

also, check logcat output , see if there sqlite errors.


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 -