android detect screen on by intent broadcast receiver

Solutions on MaxInterview for android detect screen on by intent broadcast receiver by the best coders in the world

showing results for - "android detect screen on by intent broadcast receiver"
Emeline
15 Jan 2017
1if (Build.VERSION.SDK_INT >= 26) {
2        String CHANNEL_ID = "your_channel_id";
3        NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
4                "Notification Channel Title",
5                NotificationManager.IMPORTANCE_DEFAULT);
6
7        ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
8
9        Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
10                .setContentTitle("")
11                .setContentText("").build();
12
13        startForeground(1, notification);
14    }
15
similar questions