新聞中心
LauncherShortcutInfo

java.lang.Object
|---ohos.bundle.LauncherShortcutInfo
public class LauncherShortcutInfo
extends Object提供有關(guān)從主屏幕啟動的應(yīng)用程序的啟動器ability的快捷方式的信息。
該類提供了獲取快捷方式所屬應(yīng)用程序的快捷方式 ID、圖標(biāo)和包名稱的方法。
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| LauncherShortcutInfo(Context context, ShortcutInfo shortcutInfo) | 用于創(chuàng)建 LauncherShortcutInfo 實例的構(gòu)造函數(shù)。 |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| String | getBundleName() | 獲取該快捷方式所屬的應(yīng)用程序包名稱。 |
| Element | getIcon() | 獲取該快捷方式的圖標(biāo)。 |
| ListShortcutIntent | getIntents() | 獲取此快捷方式中包含的所有 ShortcutIntent 對象。 |
| String | getLabel() | 獲取該快捷方式的標(biāo)簽。 |
| String | getShortcutId() | 獲取此快捷方式的 ID。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
構(gòu)造函數(shù)詳細信息
LauncherShortcutInfo
public LauncherShortcutInfo(Context context, ShortcutInfo shortcutInfo)
用于創(chuàng)建 LauncherShortcutInfo 實例的構(gòu)造函數(shù)。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| context | 表示快捷方式的上下文對象。 |
| shortcutInfo | 指示有關(guān)快捷方式的信息。 |
方法詳情
getShortcutId
public String getShortcutId()
獲取此快捷方式的 ID。
快捷方式 ID 唯一標(biāo)識快捷方式。
返回:
返回快捷方式 ID。
getBundleName
public String getBundleName()
獲取該快捷方式所屬的應(yīng)用程序包名稱。
返回:
返回應(yīng)用程序的包名稱。
getLabel
public String getLabel()
獲取該快捷方式的標(biāo)簽。
快捷方式的標(biāo)簽是指快捷方式列表中顯示的標(biāo)題。
返回:
返回快捷方式標(biāo)簽。
getIntents
public ListShortcutIntent getIntents()
獲取此快捷方式中包含的所有 ShortcutIntent 對象。
ohos.bundle.ShortcutIntent 對象用于導(dǎo)航到快捷方式的目標(biāo)ability。
返回:
返回此快捷方式中所有 ohos.bundle.ShortcutIntent 對象的列表。
getIcon
public Element getIcon()
獲取該快捷方式的圖標(biāo)。
快捷方式圖標(biāo)顯示在快捷方式列表中。
返回:
返回快捷方式圖標(biāo)。
本文題目:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSLauncherShortcutInfo
轉(zhuǎn)載注明:http://fisionsoft.com.cn/article/dpcoisc.html


咨詢
建站咨詢
