LauncherApps.ShortcutQuery
public
static
class
LauncherApps.ShortcutQuery
extends Object
| java.lang.Object | |
| ↳ | android.content.pm.LauncherApps.ShortcutQuery |
Represents a query passed to getShortcuts(ShortcutQuery, UserHandle).
Summary
Constants | |
|---|---|
int |
FLAG_GET_KEY_FIELDS_ONLY
Requests "key" fields only. |
int |
FLAG_MATCH_DYNAMIC
Include dynamic shortcuts in the result. |
int |
FLAG_MATCH_MANIFEST
Include manifest shortcuts in the result. |
int |
FLAG_MATCH_PINNED
Include pinned shortcuts in the result. |
Public constructors | |
|---|---|
LauncherApps.ShortcutQuery()
|
|
Public methods | |
|---|---|
LauncherApps.ShortcutQuery
|
setActivity(ComponentName activity)
If non-null, returns only shortcuts associated with the activity; i.e. |
LauncherApps.ShortcutQuery
|
setChangedSince(long changedSince)
If non-zero, returns only shortcuts that have been added or updated
since the given timestamp, expressed in milliseconds since the Epoch—see
|
LauncherApps.ShortcutQuery
|
setPackage(String packageName)
If non-null, returns only shortcuts from the package. |
LauncherApps.ShortcutQuery
|
setQueryFlags(int queryFlags)
Set query options. |
LauncherApps.ShortcutQuery
|
setShortcutIds(List<String> shortcutIds)
If non-null, return only the specified shortcuts by ID. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Constants
FLAG_GET_KEY_FIELDS_ONLY
int FLAG_GET_KEY_FIELDS_ONLY
Requests "key" fields only. See hasKeyFieldsOnly()'s javadoc to
see which fields fields "key".
This allows quicker access to shortcut information in order to
determine whether the caller's in-memory cache needs to be updated.
Typically, launcher applications cache all or most shortcut information
in memory in order to show shortcuts without a delay.
When a given launcher application wants to update its cache, such as when its process
restarts, it can fetch shortcut information with this flag.
The application can then check getLastChangedTimestamp() for each
shortcut, fetching a shortcut's non-key information only if that shortcut has been
updated.
See also:
Constant Value: 4 (0x00000004)
FLAG_MATCH_DYNAMIC
int FLAG_MATCH_DYNAMIC
Include dynamic shortcuts in the result.
Constant Value: 1 (0x00000001)
FLAG_MATCH_MANIFEST
int FLAG_MATCH_MANIFEST
Include manifest shortcuts in the result.
Constant Value: 8 (0x00000008)
FLAG_MATCH_PINNED
int FLAG_MATCH_PINNED
Include pinned shortcuts in the result.
Constant Value: 2 (0x00000002)
Public constructors
Public methods
setActivity
LauncherApps.ShortcutQuery setActivity (ComponentName activity)
If non-null, returns only shortcuts associated with the activity; i.e.
ShortcutInfos whose getActivity() are equal
to activity.
| Parameters | |
|---|---|
activity |
ComponentName This value may be |
| Returns | |
|---|---|
LauncherApps.ShortcutQuery |
|
setChangedSince
LauncherApps.ShortcutQuery setChangedSince (long changedSince)
If non-zero, returns only shortcuts that have been added or updated
since the given timestamp, expressed in milliseconds since the Epoch—see
currentTimeMillis().
| Parameters | |
|---|---|
changedSince |
long |
| Returns | |
|---|---|
LauncherApps.ShortcutQuery |
|
setPackage
LauncherApps.ShortcutQuery setPackage (String packageName)
If non-null, returns only shortcuts from the package.
| Parameters | |
|---|---|
packageName |
String This value may be |
| Returns | |
|---|---|
LauncherApps.ShortcutQuery |
|
setQueryFlags
LauncherApps.ShortcutQuery setQueryFlags (int queryFlags)
Set query options. At least one of the MATCH flags should be set. Otherwise,
no shortcuts will be returned.
| Parameters | |
|---|---|
queryFlags |
int |
| Returns | |
|---|---|
LauncherApps.ShortcutQuery |
|
setShortcutIds
LauncherApps.ShortcutQuery setShortcutIds (List<String> shortcutIds)
If non-null, return only the specified shortcuts by ID. When setting this field,
a package name must also be set with setPackage(String).
| Parameters | |
|---|---|
shortcutIds |
List This value may be |
| Returns | |
|---|---|
LauncherApps.ShortcutQuery |
|
Classes
- ActivityInfo
- ActivityInfo.WindowLayout
- ApplicationInfo
- ApplicationInfo.DisplayNameComparator
- ChangedPackages
- ComponentInfo
- ConfigurationInfo
- FeatureGroupInfo
- FeatureInfo
- InstrumentationInfo
- LabeledIntent
- LauncherActivityInfo
- LauncherApps
- LauncherApps.Callback
- LauncherApps.PinItemRequest
- LauncherApps.ShortcutQuery
- PackageInfo
- PackageInstaller
- PackageInstaller.Session
- PackageInstaller.SessionCallback
- PackageInstaller.SessionInfo
- PackageInstaller.SessionParams
- PackageItemInfo
- PackageItemInfo.DisplayNameComparator
- PackageManager
- PackageStats
- PathPermission
- PermissionGroupInfo
- PermissionInfo
- ProviderInfo
- ResolveInfo
- ResolveInfo.DisplayNameComparator
- ServiceInfo
- SharedLibraryInfo
- ShortcutInfo
- ShortcutInfo.Builder
- ShortcutManager
- Signature
- VersionedPackage
Exceptions