Android détecter l'écran par l'intention du récepteur de diffusion
if (Build.VERSION.SDK_INT >= 26) {
String CHANNEL_ID = "your_channel_id";
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
"Notification Channel Title",
NotificationManager.IMPORTANCE_DEFAULT);
((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle("")
.setContentText("").build();
startForeground(1, notification);
}
Clever Chimpanzee