Class NotificationUtil

  • All Implemented Interfaces:

    
    public class NotificationUtil
    
                        

    Created by jiangecho on 2016/11/29.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static NotificationUtil getInstance()
      void showNotification(Context context, String title, String content, PendingIntent pendingIntent, int notificationId, int defaults)
      NotificationChannel getDefaultChannel(Context context)
      void showNotification(Context context, String title, String content, PendingIntent intent, int notificationId)
      void clearNotification(Context context, int notificationId)
      int getRingerMode(Context context)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • showNotification

         void showNotification(Context context, String title, String content, PendingIntent pendingIntent, int notificationId, int defaults)
        Parameters:
        context - the context
        title - the notification title
        content - the notification content
        pendingIntent - PendingIntent
        notificationId - the notification ID
        defaults - notification defaults controlling sound/vibrate/lights, maps to Builder.
      • showNotification

         void showNotification(Context context, String title, String content, PendingIntent intent, int notificationId)