提交 75c57ae7 编写于 作者: 杜庆泉's avatar 杜庆泉

Update utsandroid.md

上级 d370e2d8
......@@ -394,3 +394,15 @@
<!-- UTSJSON.UTSAndroid.tutorial -->
```ts
// 使用外部应用打开项目内置图片资源
let file = new File(UTSAndroid.getResourcePath("static/logo.png"))
const uri = UTSAndroid.getFileProviderUri(file)
const intent = new Intent(Intent.ACTION_VIEW, uri)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
const context = UTSAndroid.getUniActivity()!;
context.startActivity(intent);
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册