OpenHarmony开发者论坛
标题:
如何拉起第三方应用
[打印本页]
作者:
润开鸿_坚果
时间:
2024-6-19 14:51
标题:
如何拉起第三方应用
[md]如何拉起第三方应用
**可以参考如下代码:**
```
import { common, Want } from '@kit.AbilityKit'
Button("打开坚果食谱").onClick(() => {
let context = getContext(this) as common.UIAbilityContext;
let want: Want = {
deviceId: "", // deviceId为空表示本设备
bundleName: "com.nutpie.cookbook",
abilityName: "EntryAbility",
parameters: {}
};
context.startAbility(want)
.then(() => {
//…
})
})
```
**完毕**
monica-code-tools
[/md]
欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/)
Powered by Discuz! X3.5