Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created November 20, 2022 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arunshaik2001/36e63c2ff4e05d606ba0a343b280b10b to your computer and use it in GitHub Desktop.
Save Arunshaik2001/36e63c2ff4e05d606ba0a343b280b10b to your computer and use it in GitHub Desktop.
private fun addAction(context: Context,action: String): PendingIntent {
val intent = Intent(context, MyBroadCastReceiver::class.java)
intent.action = action
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment