I am trying to add a button to my application. When clicked, I would like to launch a selection dialog that shows all the shortcuts or installed applications. Once selected, you must permanently install the button to launch this application.
I understand how to use packagemanager to get a list of installed applications:
PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
but do you really need to accept this and use the ListAdapter and create a separate dialog from scratch?
It seems to me that I saw this selection menu in other applications several times (for example, any launch application when you add a shortcut or to the Google Car Home application when adding a new shortcut). Is there any way to use this context menu?
I searched these forums everywhere and cannot find otherwise. Any help would be much appreciated. Thank.
source
share