Notification.Builder noteBuilder = new Notification.Builder(context) .setAutoCancel(true) .setPriority(Notification.PRIORITY_DEFAULT) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle(ContentTitle) .setContentText(ContentText) .setLights(Color.YELLOW, 500, 500) ; Intent noteIntent = new Intent(context,HoofdScherm.class); PendingIntent notePendingIntent = PendingIntent.getActivity(context, 0, noteIntent, PendingIntent.FLAG_CANCEL_CURRENT); noteBuilder.setContentIntent(notePendingIntent); Notification note = noteBuilder.build(); note.ledARGB = Color.YELLOW; NotificationManager mgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); mgr.notify(0,note);
You need to make sure all the defaults are overridden by setting notification.defaults = 0;
80,348
社区成员
91,289
社区内容
加载中
试试用AI创作助手写篇文章吧