i have to remove missed calls from notification bar in onCreate
, how ever set all "unread" to "read" is not enough
public void resetMissingCalls() {
Runnable reset = new Runnable() {
@Override
public void run() {
String[] projection = { CallLog.Calls._ID,
CallLog.Calls.CACHED_NUMBER_LABEL, CallLog.Calls.TYPE };
String where = CallLog.Calls.TYPE + "=" + CallLog.Calls.MISSED_TYPE
+ " AND " + CallLog.Calls.NEW + "=1";
Cursor c = getContentResolver().query(
CallLog.Calls.CONTENT_URI, projection, where, null, null);
Utils.PrintInfo("CALLS " + c.getCount());
c.moveToFirst();
if (c.getCount() > 0) {
do {
Utils.PrintInfo(c.getString(c
.getColumnIndex(CallLog.Calls._ID)) + " coursor "+c.getString(c
.getColumnIndex(CallLog.Calls.CACHED_NUMBER_LABEL)));
setAsRead(c.getString(c
.getColumnIndex(CallLog.Calls._ID)));
} while (c.moveToNext());
}
c.close();
}
};
new Handler().post(reset);
}
how to clear this without using NotificationManager.cancelAll()