Reputation: 129
I have developed parse push notification in my app.
What I want now push notification should clear automatically from notification bar without any click on it after 10 min.Is it possible?
Upvotes: 1
Views: 1278
Reputation: 1648
Sure, implement any handler that will wait, and after it remove your notification.
Here is description how to remove notification.
Upvotes: 2
Reputation: 505
May be this will do the trick please do the required changes
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager nMgr = (NotificationManager) getApplicationContext().getSystemService(ns);
nMgr.cancel(NOTIF_ID);
}
}, 600000);
Upvotes: 2