我正在尝试提供服务,这将启动Thread,该方法具有发送通知的方法。但是它不发送!
该方法的代码:
private void sendNotification(String lessonName) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentTitle(lessonName)
.setContentText("Test!")
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
notificationManager.notify(id, builder.build());
}
谢谢