新聞中心
ShortcutIntent

java.lang.Object
|---ohos.bundle.ShortcutIntent
public class ShortcutIntent
extends Object
implements Sequenceable提供用于獲取有關快捷方式將啟動的ability信息的方法,包括目標捆綁包名稱和ability類名稱。
嵌套類摘要
| 從接口 ohos.utils.Sequenceable 繼承的嵌套類/接口 |
|---|
| Sequenceable.ProducerT |
字段摘要
| 修飾符和類型 | 字段 | 描述 |
|---|---|---|
| static Sequenceable.ProducerShortcutIntent | PRODUCER | 從 Parcel 創(chuàng)建一個 ShortcutIntent 實例。 |
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| ShortcutIntent() | 用于創(chuàng)建 ShortcutIntent 實例的默認構(gòu)造函數(shù)。 |
| ShortcutIntent(String targetBundle, String targetClass) | 用于通過目標包和類創(chuàng)建 ShortcutIntent 實例的構(gòu)造函數(shù)。 |
| ShortcutIntent(ShortcutIntent source) | 用于通過從現(xiàn)有參數(shù)復制參數(shù)來創(chuàng)建 ShortcutIntent 實例的構(gòu)造函數(shù)。 |
方法總結(jié)
| 修飾符和類型 | Method | Description |
|---|---|---|
| void | addParam(String key, String value) | 添加鍵值對格式的參數(shù)。 |
| MapString,String | getParams() | 獲取鍵值參數(shù)。 |
| String | getTargetBundle() | 獲取此快捷方式的目標ability所屬的捆綁包的名稱。 |
| String | getTargetClass() | 獲取目標ability的類名。 |
| boolean | marshalling(Parcel out) | 將此 Sequenceable 對象編組為 Parcel。 |
| void | setTargetBundle(String targetBundle) | 設置此快捷方式的目標ability所屬的捆綁包的名稱。 |
| void | setTargetClass(String targetClass) | 設置目標ability的類名。 |
| boolean | unmarshalling(Parcel in) | 從 Parcel 中解組此 Sequenceable 對象。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 從接口 ohos.utils.Sequenceable 繼承的方法 |
|---|
| hasFileDescriptor |
字段詳細信息
PRODUCER
public static final Sequenceable.ProducerShortcutIntent PRODUCER
從 Parcel 創(chuàng)建一個 ShortcutIntent 實例。
構(gòu)造函數(shù)詳細信息
ShortcutIntent
public ShortcutIntent()
用于創(chuàng)建 ShortcutIntent 實例的默認構(gòu)造函數(shù)。
ShortcutIntent
public ShortcutIntent(ShortcutIntent source)
用于通過從現(xiàn)有參數(shù)復制參數(shù)來創(chuàng)建 ShortcutIntent 實例的構(gòu)造函數(shù)。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| source | 指示 ShortcutIntent 對象。 |
ShortcutIntent
public ShortcutIntent(String targetBundle, String targetClass)
用于通過目標包和類創(chuàng)建 ShortcutIntent 實例的構(gòu)造函數(shù)。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| targetBundle | 指示捆綁包名稱。 |
| targetClass | 表示類名。 |
方法詳情
setTargetBundle
public void setTargetBundle(String targetBundle)
設置此快捷方式的目標ability所屬的捆綁包的名稱。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| targetBundle | 指示捆綁包名稱。 |
getTargetBundle
public String getTargetBundle()
獲取此快捷方式的目標ability所屬的捆綁包的名稱。
返回:
返回捆綁包名稱。
setTargetClass
public void setTargetClass(String targetClass)
設置目標ability的類名。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| targetClass | 表示類名。 |
getTargetClass
public String getTargetClass()
獲取目標ability的類名。
返回:
返回目標ability的類名。
getParams
public MapString,String getParams()
獲取鍵值參數(shù)。
返回:
返回參數(shù)。
addParam
public void addParam(String key, String value)
添加鍵值對格式的參數(shù)。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| key | Indicates the key matching the parameter. |
| value | Indicates the value of the parameter. |
marshalling
public boolean marshalling(Parcel out)
從接口復制的描述:Sequenceable
將此 Sequenceable 對象編組為 Parcel。
指定者:
接口 Sequenceable 中的編組
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| out | 指示將 Sequenceable 對象編組到的 Parcel 對象。 |
返回:
如果編組成功,則返回 true; 否則返回 false。
unmarshalling
public boolean unmarshalling(Parcel in)
從接口復制的描述:Sequenceable
從 Parcel 中解組此 Sequenceable 對象。
指定者:
在接口 Sequenceable 中解組
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| in | 指示已將 Sequenceable 對象編組到的 Parcel 對象。 |
返回:
如果解組成功,則返回 true; 否則返回 false。
本文題目:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSShortcutIntent
標題鏈接:http://m.fisionsoft.com.cn/article/copsioe.html


咨詢
建站咨詢
