Search code examples
androidcalllog

clear missed calls and clear notification from android bar


Using this code I managed to mark all missed calls as read:

ContentValues values = new ContentValues();
        values.put(Calls.NEW, 0);
        if (android.os.Build.VERSION.SDK_INT >= 14) {
            values.put(Calls.IS_READ, 1);
        }
        StringBuilder where = new StringBuilder();
        where.append(Calls.NEW);
        where.append(" = 1 AND ");
        where.append(Calls.TYPE);
        where.append(" = ?");

        context.getContentResolver().update(Calls.CONTENT_URI, values, where.toString(),
                new String[]{ Integer.toString(Calls.MISSED_TYPE) });

but in the android notification bar I still have a flag with missed calls. How can I also clear the notification bar for calls in android?


Solution

  • How can I also clear the notification bar for calls in android?

    You don't. That Notification is put there by another app, and you have no means of controlling whether that Notification is displayed, short of building a ROM mod that changes the behavior of that other app.

    UPDATE: Since this answer was originally written, NotificationListenerService was added and can clear notifications, but only on Android 4.3+.