Created
July 23, 2020 12:59
-
-
Save kingjinho/dce70a6d3482a04c51b0f1a3ecd0a549 to your computer and use it in GitHub Desktop.
Action Button
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 setActionButton(btnTitle: String): NotificationBuilder { | |
val intent = Intent(CONTEXT, MainActivity::class.java).apply { | |
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | |
} | |
val pendingIntent = PendingIntent.getActivity(CONTEXT, 0, intent, 0) | |
mNotificationBuilder.addAction(R.drawable.ic_launcher_playstore, btnTitle, pendingIntent) | |
return this | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment