Skip to content

Instantly share code, notes, and snippets.

@kingjinho
Created July 23, 2020 12:59
Show Gist options
  • Save kingjinho/dce70a6d3482a04c51b0f1a3ecd0a549 to your computer and use it in GitHub Desktop.
Save kingjinho/dce70a6d3482a04c51b0f1a3ecd0a549 to your computer and use it in GitHub Desktop.
Action Button
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