W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
java.lang.Object
|---ohos.bundle.ShortcutInfo
public class ShortcutInfo
extends Object
implements Sequenceable
提供有關(guān)快捷方式的信息,包括快捷方式 ID 和標(biāo)簽。
從接口 ohos.utils.Sequenceable 繼承的嵌套類/接口 |
---|
Sequenceable.ProducerT |
修飾符和類型 | 字段 | 描述 |
---|---|---|
static Sequenceable.ProducerShortcutInfo | PRODUCER | 從 Parcel 創(chuàng)建一個(gè) ShortcutInfo 實(shí)例。 |
構(gòu)造函數(shù) | 描述 |
---|---|
ShortcutInfo() | 用于創(chuàng)建 ShortcutInfo 實(shí)例的默認(rèn)構(gòu)造函數(shù)。 |
ShortcutInfo(ShortcutInfo source) | 用于通過(guò)從現(xiàn)有參數(shù)復(fù)制參數(shù)來(lái)創(chuàng)建 ShortcutInfo 實(shí)例的構(gòu)造函數(shù)。 |
修飾符和類型 | 方法 | 描述 |
---|---|---|
String | getBundleName() | 獲取該快捷方式所屬的應(yīng)用程序包名稱。 |
String | getDisableMessage() | 獲取此快捷方式的禁用消息。 |
String | getHostAbilityName() | 獲取托管此快捷方式的ability的類名。 |
String | getIcon() | 獲取該快捷方式的圖標(biāo)路徑。 |
String | getId() | 獲取此快捷方式的 ID。 |
ShortcutIntent | getIntent() | 獲取此快捷方式的 ShortcutIntent 對(duì)象。 |
ListShortcutIntent | getIntents() | 獲取此快捷方式中包含的所有 ShortcutIntent 對(duì)象。 |
String | getLabel() | 獲取該快捷方式的標(biāo)簽。 |
boolean | isEnabled() | 檢查是否啟用了此快捷方式。 |
boolean | isHomeShortcut() | 檢查此快捷方式是否是主屏幕快捷方式。 |
boolean | isStatic() | 檢查此快捷方式是否是靜態(tài)的。 |
boolean | marshalling(Parcel out) | 將此 Sequenceable 對(duì)象編組為 Parcel。 |
void | setBundleName(String bundleName) | 設(shè)置此快捷方式的 bundleName。 |
void | setDisableMessage(String disableMessage) | 設(shè)置此快捷方式的禁用消息。 |
void | setHostAbilityName(String hostAbility) | 設(shè)置托管此快捷方式的ability的類名。 |
void | setIcon(String icon) | 設(shè)置此快捷方式的圖標(biāo)路徑。 |
void | setId(String id) | 設(shè)置此快捷方式的 ID。 |
void | setIntent(ShortcutIntent intent) | 設(shè)置此快捷方式的 ShortcutIntent。 |
void | setIntents(ListShortcutIntent intents) | 為此快捷方式設(shè)置多個(gè)intent。 |
void | setLabel(String label) | 設(shè)置此快捷方式的標(biāo)簽。 |
boolean | unmarshalling(Parcel in) | 從 Parcel 中解組此 Sequenceable 對(duì)象。 |
從類 java.lang.Object 繼承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
從接口 ohos.utils.Sequenceable 繼承的方法 |
---|
hasFileDescriptor |
public static final Sequenceable.ProducerShortcutInfo PRODUCER
從 Parcel 創(chuàng)建一個(gè) ShortcutInfo 實(shí)例。
public ShortcutInfo()
用于創(chuàng)建 ShortcutInfo 實(shí)例的默認(rèn)構(gòu)造函數(shù)。
public ShortcutInfo(ShortcutInfo source)
用于通過(guò)從現(xiàn)有參數(shù)復(fù)制參數(shù)來(lái)創(chuàng)建 ShortcutInfo 實(shí)例的構(gòu)造函數(shù)。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
source | 指示 ShortcutInfo 對(duì)象。 |
public void setId(String id)
設(shè)置此快捷方式的 ID。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
id | 表示要設(shè)置的快捷方式ID。 |
public String getId()
獲取此快捷方式的 ID。
快捷方式 ID 唯一標(biāo)識(shí)快捷方式。
返回:
返回快捷方式 ID。
public void setBundleName(String bundleName)
設(shè)置此快捷方式的 bundleName。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
bundleName | 指示此快捷方式所屬的應(yīng)用程序的捆綁包名稱。 |
public String getBundleName()
獲取該快捷方式所屬的應(yīng)用程序包名稱。
返回:
返回應(yīng)用程序的包名稱。
public void setHostAbilityName(String hostAbility)
設(shè)置托管此快捷方式的ability的類名。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
hostAbility | 指示創(chuàng)建此快捷方式的ability的類名。 |
public String getHostAbilityName()
獲取托管此快捷方式的ability的類名。
返回:
返回此快捷方式的宿主ability的類名。
public void setIcon(String icon)
設(shè)置此快捷方式的圖標(biāo)路徑。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
icon | 表示快捷方式圖標(biāo)的存放路徑。 |
public String getIcon()
獲取該快捷方式的圖標(biāo)路徑。
返回:
返回存儲(chǔ)快捷方式圖標(biāo)的路徑。
public void setLabel(String label)
設(shè)置此快捷方式的標(biāo)簽。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
快捷方式的標(biāo)簽是用戶可見的快捷方式信息。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
label | 指示要設(shè)置的快捷方式標(biāo)簽。 |
public String getLabel()
獲取該快捷方式的標(biāo)簽。
返回:
返回快捷方式標(biāo)簽。
public void setDisableMessage(String disableMessage)
設(shè)置此快捷方式的禁用消息。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
disableMessage | 指示要設(shè)置的禁用消息。 |
public String getDisableMessage()
獲取此快捷方式的禁用消息。
返回:
返回快捷方式禁用消息。
public void setIntents(ListShortcutIntent intents)
為此快捷方式設(shè)置多個(gè)intent。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
如果為一個(gè)快捷方式設(shè)置了多個(gè)intent,則所有這些 ShortcutIntent 對(duì)象中指定的ability將在快捷方式啟動(dòng)時(shí)依次啟動(dòng)。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
intents | 指示要設(shè)置的 ShortcutIntent 對(duì)象的列表。 |
public void setIntent(ShortcutIntent intent)
設(shè)置此快捷方式的 ShortcutIntent。 如果多次調(diào)用此方法,則最近一次調(diào)用中設(shè)置的 ShortcutIntent 將覆蓋之前的。 此方法對(duì)靜態(tài)快捷方式無(wú)效。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
intent | 指示要設(shè)置的 ShortcutIntent 對(duì)象。 |
public ListShortcutIntent getIntents()
獲取此快捷方式中包含的所有 ShortcutIntent 對(duì)象。
ohos.bundle.ShortcutIntent 對(duì)象用于導(dǎo)航到快捷方式的目標(biāo)ability。
返回:
返回此快捷方式中所有 ohos.bundle.ShortcutIntent 對(duì)象的列表。
public ShortcutIntent getIntent()
獲取此快捷方式的 ShortcutIntent 對(duì)象。 如果有多個(gè)intent,則返回 ShortcutIntent 列表中的最后一個(gè)。
返回:
返回此快捷方式的 ShortcutIntent 列表中的最后一個(gè)對(duì)象。
public boolean isStatic()
檢查此快捷方式是否是靜態(tài)的。
返回:
如果此快捷方式是靜態(tài)的,則返回 true; 否則返回 false。
public boolean isHomeShortcut()
檢查此快捷方式是否是主屏幕快捷方式。
返回:
如果此快捷方式是主屏幕快捷方式,則返回 true; 否則返回 false。
public boolean isEnabled()
檢查是否啟用了此快捷方式。
返回:
如果啟用此快捷方式,則返回 true; 否則返回 false。
public boolean marshalling(Parcel out)
從接口復(fù)制的描述:Sequenceable
將此 Sequenceable 對(duì)象編組為 Parcel。
指定者:
接口 Sequenceable 中的編組
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
out | 指示將 Sequenceable 對(duì)象編組到的 Parcel 對(duì)象。 |
返回:
如果編組成功,則返回 true; 否則返回 false。
public boolean unmarshalling(Parcel in)
從接口復(fù)制的描述:Sequenceable
從 Parcel 中解組此 Sequenceable 對(duì)象。
指定者:
在接口 Sequenceable 中解組
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
in | 指示已將 Sequenceable 對(duì)象編組到的 Parcel 對(duì)象。 |
返回:
如果解組成功,則返回 true; 否則返回 false。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: