Skip to content

Instantly share code, notes, and snippets.

@saurabharora90
Created July 9, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save saurabharora90/a5167d53385876dfcd73ce74e1904792 to your computer and use it in GitHub Desktop.
Save saurabharora90/a5167d53385876dfcd73ce74e1904792 to your computer and use it in GitHub Desktop.
Beginning with Android Q, Background Activity Starts should be done by notification triggered activities.
val fullScreenIntent = Intent(this, CallActivity::class.java)
val fullScreenPendingIntent = PendingIntent.getActivity(this, 0,
fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT)
val notificationBuilder = NotificationCompat.Builder(this, CHANNEL_ID)
....
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_CALL)
.setFullScreenIntent(fullScreenPendingIntent, true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment