Created
August 17, 2020 06:49
-
-
Save alperenbabagil/18264a532fb4d76cbb1f4ba5514513fc 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
val builder = NotificationCompat.Builder(context, AppNavigator.NOTF_CHANNEL_ID) | |
.setSmallIcon(android.R.drawable.arrow_up_float) | |
.setContentTitle(context.getString(R.string.app_name)) | |
.setContentText(context.getString(R.string.channel_description)) | |
.setPriority(NotificationCompat.PRIORITY_HIGH) | |
.setCategory(NotificationCompat.CATEGORY_CALL) | |
.setAutoCancel(true) | |
val pendingIntent = PendingIntent.getActivity(context, | |
0, | |
Intent(context, RingActivity::class.java), | |
PendingIntent.FLAG_UPDATE_CURRENT) | |
builder.setFullScreenIntent(pendingIntent,true) // setting full screen intent here | |
val mgr = | |
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager | |
mgr.cancel(notfId) | |
mgr.notify(notfId,builder.build()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment