I have seen ways to make shortcuts, but I need to find a way to get a list of shortcuts installed on the phone.
I want my user to be able to select one of his/her sh
In addition to Jonathan,
Each app can do shortcuts. Each shortcut specified in app's manifest. So you can get shortcuts list (this method in activity):
Kotlin
fun printShortcuts() {
val shortcutIntent = Intent(Intent.ACTION_CREATE_SHORTCUT)
val shortcuts = packageManager.queryIntentActivities(shortcutIntent, 0)
shortcuts.forEach {
println("name = ${it.activityInfo.name}, label = ${it.loadLabel(packageManager)}")
}
}
It will print something like:
I/System.out: name = com.whatsapp.camera.CameraActivity, label = WhatsApp Camera
I/System.out: name = com.android.contacts.ContactShortcut, label = Contact
I/System.out: name = alias.DialShortcut, label = Direct dial
I/System.out: name = alias.MessageShortcut, label = Direct message