java.lang.Object | |
↳ | android.content.pm.LauncherApps |
Class for retrieving a list of launchable activities for the current user and any associated managed profiles. This is mainly for use by launchers. Apps can be queried for each user profile. Since the PackageManager will not deliver package broadcasts for other profiles, you can register for package changes here.
To watch for managed profiles being added or removed, register for the following broadcasts:
ACTION_MANAGED_PROFILE_ADDED
and ACTION_MANAGED_PROFILE_REMOVED
.
You can retrieve the list of profiles associated with this user with
getUserProfiles()
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LauncherApps.Callback | Callbacks for package changes to this and related managed profiles. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves a list of launchable activities that match
ACTION_MAIN and
CATEGORY_LAUNCHER , for a specified user.
| |||||||||||
Checks if the activity exists and it enabled for a profile.
| |||||||||||
Checks if the package is installed and enabled for a profile.
| |||||||||||
Registers a callback for changes to packages in current and managed profiles.
| |||||||||||
Registers a callback for changes to packages in current and managed profiles.
| |||||||||||
Returns the activity info for a given intent and user handle, if it resolves.
| |||||||||||
Starts the settings activity to show the application details for a
package in the specified profile.
| |||||||||||
Starts a Main activity in the specified profile.
| |||||||||||
Unregisters a callback that was previously registered.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Retrieves a list of launchable activities that match ACTION_MAIN
and
CATEGORY_LAUNCHER
, for a specified user.
packageName | The specific package to query. If null, it checks all installed packages in the profile. |
---|---|
user | The UserHandle of the profile. |
Checks if the activity exists and it enabled for a profile.
component | The activity to check. |
---|---|
user | The UserHandle of the profile. |
Checks if the package is installed and enabled for a profile.
packageName | The package to check. |
---|---|
user | The UserHandle of the profile. |
Registers a callback for changes to packages in current and managed profiles.
callback | The callback to register. |
---|
Registers a callback for changes to packages in current and managed profiles.
callback | The callback to register. |
---|---|
handler | that should be used to post callbacks on, may be null. |
Returns the activity info for a given intent and user handle, if it resolves. Otherwise it returns null.
intent | The intent to find a match for. |
---|---|
user | The profile to look in for a match. |
Starts the settings activity to show the application details for a package in the specified profile.
component | The ComponentName of the package to launch settings for. |
---|---|
user | The UserHandle of the profile |
sourceBounds | The Rect containing the source bounds of the clicked icon |
opts | Options to pass to startActivity |
Starts a Main activity in the specified profile.
component | The ComponentName of the activity to launch |
---|---|
user | The UserHandle of the profile |
sourceBounds | The Rect containing the source bounds of the clicked icon |
opts | Options to pass to startActivity |
Unregisters a callback that was previously registered.
callback | The callback to unregister. |
---|