提交 ec094db6 编写于 作者: DCloud-yyl's avatar DCloud-yyl

补充UTSAndroid的getAppContext、getUniActivity描述信息

上级 17f6a583
...@@ -262,12 +262,16 @@ UTSAndroid.offAppActivityBack(() => { ...@@ -262,12 +262,16 @@ UTSAndroid.offAppActivityBack(() => {
<!-- UTSJSON.UTSAndroid.getAppContext.description --> <!-- UTSJSON.UTSAndroid.getAppContext.description -->
> HBuilderX4.31及以上版本推荐使用 [getApp().getAndroidApplication()](../api/get-app.md#getandroidapplication) 获取android原生 [Application](https://developer.android.google.cn/reference/android/app/Application)。
<!-- UTSJSON.UTSAndroid.getAppContext.param --> <!-- UTSJSON.UTSAndroid.getAppContext.param -->
<!-- UTSJSON.UTSAndroid.getAppContext.returnValue --> <!-- UTSJSON.UTSAndroid.getAppContext.returnValue -->
<!-- UTSJSON.UTSAndroid.getAppContext.compatibility --> <!-- UTSJSON.UTSAndroid.getAppContext.compatibility -->
<!-- UTSJSON.UTSAndroid.getAppContext.tutorial -->
```uts ```uts
let packageName = UTSAndroid.getAppContext()?.packageName let packageName = UTSAndroid.getAppContext()?.packageName
console.log("packageName",packageName) console.log("packageName",packageName)
...@@ -277,12 +281,16 @@ console.log("packageName",packageName) ...@@ -277,12 +281,16 @@ console.log("packageName",packageName)
<!-- UTSJSON.UTSAndroid.getUniActivity.description --> <!-- UTSJSON.UTSAndroid.getUniActivity.description -->
> 在uvue页面中也可先通过 [uni.getElementById](../api/get-element-by-id.md) 获取节点元素对象 [UniElement](../dom/unielement.md),在调用其 [getAndroidActivity](../dom/unielement.md#getandroidactivity) 获取android原生 [Activity](https://developer.android.google.cn/reference/android/app/Activity)。
<!-- UTSJSON.UTSAndroid.getUniActivity.param --> <!-- UTSJSON.UTSAndroid.getUniActivity.param -->
<!-- UTSJSON.UTSAndroid.getUniActivity.returnValue --> <!-- UTSJSON.UTSAndroid.getUniActivity.returnValue -->
<!-- UTSJSON.UTSAndroid.getUniActivity.compatibility --> <!-- UTSJSON.UTSAndroid.getUniActivity.compatibility -->
<!-- UTSJSON.UTSAndroid.getUniActivity.tutorial -->
```uts ```uts
// 获取第一个可以响应图像采集行为组件 // 获取第一个可以响应图像采集行为组件
let takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); let takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册