我正在尝试找出将一些 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/