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.OnAppsChangedListener | Callbacks for package changes to this and related managed profiles. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a listener for changes to packages in current and managed profiles.
| |||||||||||
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.
| |||||||||||
Removes a listener that was previously added.
| |||||||||||
Returns the activity info for a given intent and user handle, if it resolves.
| |||||||||||
Starts an activity in the specified profile.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Adds a listener for changes to packages in current and managed profiles.
listener | The listener to add. |
---|
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. |
Removes a listener that was previously added.
listener | The listener to remove. |
---|
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 an 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 |