calllog - how to mask missed calls to read in android? -
i working android app displays missed calls using:
string[] projection = new string[]{calllog.calls.number, calllog.calls.type, calllog.calls.duration, calllog.calls.cached_name, calllog.calls._id}; string = calllog.calls.type+"="+calllog.calls.missed_type+" , " + calllog.calls.new + "=1" ; cursor c = context.getcontentresolver().query(calllog.calls.content_uri,projection,where, null, null); c.movetofirst(); if(c.getcount() > 0) newcountersobj.missedcallcounter=c.getcount(); after checking missed calls in android listview want mark them read in android db. how can that?
question update following link:
by setting is_read flag true. reference: http://developer.android.com/reference/android/provider/calllog.calls.html#is_read
example (from clearmissedcallsservice):
// clear list of new missed calls. contentvalues values = new contentvalues(); values.put(calls.new, 0); values.put(calls.is_read, 1); stringbuilder = new stringbuilder(); where.append(calls.new); where.append(" = 1 , "); where.append(calls.type); where.append(" = ?"); context.getcontentresolver().update(calls.content_uri, values, where.tostring(), new string[]{ integer.tostring(calls.missed_type) });
Comments
Post a Comment