1

whenever we get a call, we do see missed call notification. Is there a way to remove the missed call notification in android programatically?

We see missed calls numbers & its count. Can we remove them via code?

Naruto
  • 9,476
  • 37
  • 118
  • 201
  • 2
    possible duplicate: http://stackoverflow.com/questions/5235776/remove-notification-from-notification-bar-from-other-applications – EJK Oct 07 '14 at 14:22
  • in removing missed call notification, what is the id & other details? – Naruto Oct 07 '14 at 14:24
  • possible duplicate of [Android - remove missed call notification](http://stackoverflow.com/questions/7736613/android-remove-missed-call-notification) – krossovochkin Oct 07 '14 at 14:29
  • Hey, in your answer he is deleting entry but not clearing. – Naruto Oct 07 '14 at 14:34

1 Answers1

1

The only "legal" but extremely ugly and usually useless way to achieve what you want is to show Call Log to user. And I mean literally show (becomes visual, gets focus). In case you want to do this, here's how:

public static boolean showCallLog(Context context)
{
    try
    {
        Intent showCallLog = new Intent();
        showCallLog.setAction(Intent.ACTION_VIEW);
        showCallLog.setType(android.provider.CallLog.Calls.CONTENT_TYPE);
        context.startActivity(showCallLog);
        return true;
    }
    catch (Exception e)
    {
        Log.d("Couldn't show call log.", e.getMessage());
    }
    return false;
}

The reason behind this mess is the fact that apps authoritatively responsible for call logging and notifying users about missed calls (stock phone apps) use cached values. Why? Because of overall performance. You need to somehow notify those apps that Call Log has changed (seen means changed, as well) and that it should update it. It would be nice if all such apps on all devices would receive a broadcast in order to refresh, but as far as I know, it's not the case.

I hope someone will find a better way to force refresh on stock phone apps.

Budimir Grom
  • 756
  • 6
  • 12
  • I can't see why this gets no upvotes. It helped me. Now I can show the user that there are missed calls and he can then inspect them in the telephone app of that device - and missed calls get cleared that way. – FrankKrumnow Nov 19 '20 at 10:01