-
-
Save Arunshaik2001/77cbb84fa43e24c1e85fd26e588defaa 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
private fun createDynamicShortcut( | |
message: SimpleMessage, | |
icon: IconCompat, | |
person: androidx.core.app.Person | |
): ShortcutInfoCompat { | |
return ShortcutInfoCompat.Builder(context, message.id.toString()) | |
.setLongLived(true) | |
.setIntent( | |
Intent(context, MainActivity3::class.java) | |
.setAction(Intent.ACTION_VIEW) | |
.setData(createContentUri(message.text)) | |
) | |
.setShortLabel(message.sender) | |
.setIcon(icon) | |
.setPerson(person) | |
.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment