android 在外部浏览器中打开链接

标签 android webview

我正在尝试找出将一些 html 与 flash 打包在一起并将其 bundle 为 android 项目的方法。 而不是创建 webview 并加载 webview

webView.loadUrl("file:///..");

是否可以在平板电脑的 native (外部)浏览器中加载 bundle 文件?

最佳答案

您需要在 Intent 中添加可浏览的类别。

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile("file:////"));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
startActivity(intent);

注意:不要硬编码路径使用Evironment.getExternalEnvironment()获取外部sdcard的路径

关于android 在外部浏览器中打开链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10303477/

相关文章:

Android WebView : Intercept redirect requests?

javascript - 使用 Electron 在 Web View 中实现缩放功能

android - 确定多个 View 中哪个VIEW有手势(双击、向左滑动、向右滑动等)?

android - ScrollTo 和 ScrollToExact 相当于 appium for android 中的 webView

java - 使用改造和 RXJava 2 的多个 API 调用

android - 无法在 Ubuntu 11.10 上启动 Android Emulator - 确保 SDK 目录设置正确

android - 通过 Intent 在 Android 浏览器中运行 javascript 代码

android - Webview 文本选择不清除

android - TabLayout 选项卡文本未显示

java - MediaRecorder 启动在无效状态下调用 : 0