W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
java.lang.Object
|---ohos.bundle.LauncherShortcutInfo
public class LauncherShortcutInfo
extends Object
提供有關(guān)從主屏幕啟動的應(yīng)用程序的啟動器ability的快捷方式的信息。
該類提供了獲取快捷方式所屬應(yīng)用程序的快捷方式 ID、圖標和包名稱的方法。
構(gòu)造函數(shù) | 描述 |
---|---|
LauncherShortcutInfo(Context context, ShortcutInfo shortcutInfo) | 用于創(chuàng)建 LauncherShortcutInfo 實例的構(gòu)造函數(shù)。 |
修飾符和類型 | 方法 | 描述 |
---|---|---|
String | getBundleName() | 獲取該快捷方式所屬的應(yīng)用程序包名稱。 |
Element | getIcon() | 獲取該快捷方式的圖標。 |
ListShortcutIntent | getIntents() | 獲取此快捷方式中包含的所有 ShortcutIntent 對象。 |
String | getLabel() | 獲取該快捷方式的標簽。 |
String | getShortcutId() | 獲取此快捷方式的 ID。 |
從類 java.lang.Object 繼承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
public LauncherShortcutInfo(Context context, ShortcutInfo shortcutInfo)
用于創(chuàng)建 LauncherShortcutInfo 實例的構(gòu)造函數(shù)。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
context | 表示快捷方式的上下文對象。 |
shortcutInfo | 指示有關(guān)快捷方式的信息。 |
public String getShortcutId()
獲取此快捷方式的 ID。
快捷方式 ID 唯一標識快捷方式。
返回:
返回快捷方式 ID。
public String getBundleName()
獲取該快捷方式所屬的應(yīng)用程序包名稱。
返回:
返回應(yīng)用程序的包名稱。
public String getLabel()
獲取該快捷方式的標簽。
快捷方式的標簽是指快捷方式列表中顯示的標題。
返回:
返回快捷方式標簽。
public ListShortcutIntent getIntents()
獲取此快捷方式中包含的所有 ShortcutIntent 對象。
ohos.bundle.ShortcutIntent 對象用于導(dǎo)航到快捷方式的目標ability。
返回:
返回此快捷方式中所有 ohos.bundle.ShortcutIntent 對象的列表。
public Element getIcon()
獲取該快捷方式的圖標。
快捷方式圖標顯示在快捷方式列表中。
返回:
返回快捷方式圖標。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: