Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在android 3.x中打开local-html-file-with-android-browser大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
android 2.x我可以使用该解决方

browserIntent.setClassName("com.android.browser","com.android.browser.browserActivity")

在帖子中解决

opening local html file with Android Browser

但是使用android 3.2我有这个错误

Unable to find explicit activity class 
(com.android.browser/com.android.browser.browserActivity); 
have you declared this activity in your AndroidManifest.xml?

我认为Android 3.x中不存在类com.android.browser.browserActivity

解决方案吗

解决方法

不是一个令人满意的解决方案,但在演示应用程序中,我使用以下代码

String url = "content://com.android.htmlfileprovider/sdcard/mydir/myfile.html";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(url),"text/html");
startActivity(intent);

通常至少有两个作品中的一个.

https://github.com/nicolas-raoul/OxygenGuide-Android/blob/master/src/org/github/OxygenGuide/MainActivity.java#L69

大佬总结

以上是大佬教程为你收集整理的在android 3.x中打开local-html-file-with-android-browser全部内容,希望文章能够帮你解决在android 3.x中打开local-html-file-with-android-browser所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。