public static class LauncherApps.ShortcutQuery extends Object
LauncherApps.getShortcuts(ShortcutQuery, UserHandle)
.Modifier and Type | Class and Description |
---|---|
static interface |
LauncherApps.ShortcutQuery.QueryFlags |
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_GET_ALL_KINDS
Deprecated.
|
static int |
FLAG_GET_DYNAMIC
Deprecated.
|
static int |
FLAG_GET_KEY_FIELDS_ONLY
Requests "key" fields only.
|
static int |
FLAG_GET_MANIFEST
Deprecated.
|
static int |
FLAG_GET_PINNED
Deprecated.
|
static int |
FLAG_MATCH_ALL_KINDS |
static int |
FLAG_MATCH_DYNAMIC
Include dynamic shortcuts in the result.
|
static int |
FLAG_MATCH_MANIFEST
Include manifest shortcuts in the result.
|
static int |
FLAG_MATCH_PINNED
Include pinned shortcuts in the result.
|
Constructor and Description |
---|
ShortcutQuery() |
Modifier and Type | Method and Description |
---|---|
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
System.currentTimeMillis() . |
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.
|
public static final int FLAG_MATCH_DYNAMIC
@Deprecated public static final int FLAG_GET_DYNAMIC
public static final int FLAG_MATCH_PINNED
@Deprecated public static final int FLAG_GET_PINNED
public static final int FLAG_MATCH_MANIFEST
@Deprecated public static final int FLAG_GET_MANIFEST
public static final int FLAG_MATCH_ALL_KINDS
@Deprecated public static final int FLAG_GET_ALL_KINDS
public static final int FLAG_GET_KEY_FIELDS_ONLY
ShortcutInfo.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 ShortcutInfo.getLastChangedTimestamp()
for each
shortcut, fetching a shortcut's non-key information only if that shortcut has been
updated.
ShortcutManager
,
Constant Field Valuespublic LauncherApps.ShortcutQuery setChangedSince(long changedSince)
System.currentTimeMillis()
.public LauncherApps.ShortcutQuery setPackage(String packageName)
public LauncherApps.ShortcutQuery setShortcutIds(List<String> shortcutIds)
setPackage(java.lang.String)
.public LauncherApps.ShortcutQuery setActivity(ComponentName activity)
ShortcutInfo
s whose ShortcutInfo.getActivity()
are equal
to activity
.public LauncherApps.ShortcutQuery setQueryFlags(int queryFlags)
MATCH
flags should be set. Otherwise,
no shortcuts will be returned.