【发布时间】:2019-07-18 08:19:14
【问题描述】:
我正在使用 Cordova 包装第三方 iframe。在 iframe 中有一个上传按钮。 它适用于 iOS,我可以选择要上传的照片(见下面的截图)。
在 Android 上虽然当我点击应该提示用户打开图库以选择文件的上传按钮时没有任何反应。
控制台中没有错误,但我在 LogCat 中发现了这个错误:
No activity found to handle file chooser intent: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT cat=[android.intent.category.OPENABLE] typ=.jpg,.png,.tiff,.jpeg,.tif,.pdf }
那个错误告诉我the device has no applications installed that are able to handle that particular implicit intent。但为什么它不能使用默认的照片或文件应用程序?当我尝试使用移动浏览器上传图片时,文件应用程序会正确显示。
我该如何解决?
- 我是否需要授予其他权限?我已经添加了以下内容:
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
- 我的 config.xml 中是否缺少特定的允许意图? 我当前的设置如下:
<allow-intent href="https://*.mydomain.com.*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
- 我需要安装额外的 Cordova 插件吗?
【问题讨论】:
标签: android cordova ionic-framework hybrid-mobile-app