public class NotificationUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
clearNotification(android.content.Context context,
int notificationId) |
android.app.NotificationChannel |
getDefaultChannel(android.content.Context context) |
static NotificationUtil |
getInstance() |
int |
getRingerMode(android.content.Context context) |
void |
showNotification(android.content.Context context,
java.lang.String title,
java.lang.String content,
android.app.PendingIntent intent,
int notificationId) |
void |
showNotification(android.content.Context context,
java.lang.String title,
java.lang.String content,
android.app.PendingIntent pendingIntent,
int notificationId,
int defaults) |
public static NotificationUtil getInstance()
public void showNotification(android.content.Context context, java.lang.String title, java.lang.String content, android.app.PendingIntent pendingIntent, int notificationId, int defaults)
context
- 上下文title
- 标题content
- 内容pendingIntent
- PendingIntentnotificationId
- 通知 iddefaults
- 控制通知属性, 对应public Builder setDefaults(int defaults)public android.app.NotificationChannel getDefaultChannel(android.content.Context context)
public void showNotification(android.content.Context context, java.lang.String title, java.lang.String content, android.app.PendingIntent intent, int notificationId)
public void clearNotification(android.content.Context context, int notificationId)
public int getRingerMode(android.content.Context context)