#鸿蒙学习大百科#如果通过代码打开证书管理器页面?

如果通过代码打开证书管理器页面?

HarmonyOS
2024-09-27 10:29:28
750浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Potatoes先生
import { common, Want } from '@kit.AbilityKit'
import { BusinessError } from '@kit.BasicServicesKit'
/**
 * 打开证书与凭证页面
 */
@Entry
@Component
struct Index {
  build() {
    Column() {
      Button("aaaaa").onClick(() => {
        let wantlnfo: Want = {
          deviceId: '',
          bundleName: "com.ohos.certmanager",
          abilityName: 'MainAbility'
        }
        let context = getContext(this) as common.UIAbilityContext
        context.startAbility(wantlnfo).then(() => {
          console.log("============success")
        }).catch((err: BusinessError) => {
          console.log("==========err:" + err.message)
        })
      })
    }.width("100%")
    .height("100%")
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
分享
微博
QQ
微信
回复
2024-09-27 15:34:30


相关问题
#鸿蒙学习大百科#模拟如何抓包?
1171浏览 • 1回复 待解决