Como se establece en 0 notificación recuento androide base de fuego

Tagir Ahmad:

¿Cómo se pone a 0 el recuento de notificación de Android con base de fuego después de abrir la aplicación?

¿Hay alguna equivalente de Swift de la applicationDidBecomeActive

UIApplication.shared.applicationIconBadgeNumber = 0 ?

¡Gracias!

Vidor Vistrom:
import android.app.NotificationManager;
import android.content.Context;

@Override
protected void onResume() {
    super.onResume();

    // Removing All Notifications
    cancelAllNotifications();
}

private void cancelAllNotifications() {
    NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancelAll();
}

Supongo que te gusta

Origin http://43.154.161.224:23101/article/api/json?id=362745&siteId=1
Recomendado
Clasificación