-
-
Save Arunshaik2001/f9fd7de40ecb0237fc603b614da3dd77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun createFullScreenIntentNotification(context: Context){ | |
val fullScreenIntent = Intent(context, MainActivity2::class.java) | |
val fullScreenPendingIntent = PendingIntent.getActivity(context, 0, | |
fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE) | |
val notificationBuilder = | |
NotificationCompat.Builder(context, NotificationChannels.CHANNEL1) | |
.setSmallIcon(R.drawable.desk) | |
.setContentTitle("Incoming call") | |
.setContentText("+9178458787XXX") | |
.setPriority(NotificationCompat.PRIORITY_HIGH) | |
.setCategory(NotificationCompat.CATEGORY_CALL) | |
.setFullScreenIntent(fullScreenPendingIntent, true) | |
val incomingCallNotification = notificationBuilder.build() | |
with(NotificationManagerCompat.from(context)) { | |
notify(1445457, incomingCallNotification) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment