public class LauncherShortcutInfo extends Object
This class provides methods for obtaining the shortcut ID, icon, and bundle name of the application to which the shortcut belongs.
| 构造器 | 说明 |
|---|---|
LauncherShortcutInfo(Context context,
ShortcutInfo shortcutInfo) |
A constructor used to create a
LauncherShortcutInfo instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getBundleName() |
Obtains the bundle name of the application to which this shortcut belongs.
|
Element |
getIcon() |
Obtains the icon of this shortcut.
|
List<ShortcutIntent> |
getIntents() |
Obtains all
ShortcutIntent objects contained in this shortcut. |
String |
getLabel() |
Obtains the label of this shortcut.
|
String |
getShortcutId() |
Obtains the ID of this shortcut.
|
public LauncherShortcutInfo(Context context, ShortcutInfo shortcutInfo)
LauncherShortcutInfo instance.context - Indicates the Context object of the shortcut.shortcutInfo - Indicates information about the shortcut.public String getShortcutId()
The shortcut ID uniquely identifies a shortcut.
public String getBundleName()
public String getLabel()
The label of a shortcut refers to the title displayed in the shortcut list.
public List<ShortcutIntent> getIntents()
ShortcutIntent objects contained in this shortcut.
The ohos.bundle.ShortcutIntent objects are used for navigating to a shortcut's target ability.
ohos.bundle.ShortcutIntent objects in this shortcut.public Element getIcon()
The shortcut icon is displayed in the shortcut list.