Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Get Installed Shortcuts

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 shortcuts and launch it from my application. Is there a way to do this (an API) or will I need a reflection method to call a system service?

like image 633
SemperGumbee Avatar asked Jun 01 '11 05:06

SemperGumbee


2 Answers

Here is how it is done in the Launcher...

Intent shortcutsIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT);
List<ResolveInfo> shortcuts = getPackageManager().queryIntentActivities(shortcutsIntent, 0);
like image 184
Jonathan Avatar answered Nov 05 '22 03:11

Jonathan


The shortcuts are private to Launcher. There is no API, and anything you try to do will be very fragile as different launcher implementations (and versions) will have different storage structures.

like image 38
hackbod Avatar answered Nov 05 '22 04:11

hackbod