如何复制并运行Android手机中的html5文件';什么是记忆?
我正在开发一个android应用程序,它应该在启动时打开HTML5文件。我所做的是如何复制并运行Android手机中的html5文件';什么是记忆?,android,html,Android,Html,我正在开发一个android应用程序,它应该在启动时打开HTML5文件。我所做的是 我将完整的html应用程序保存在android资产文件夹下 我无法直接使用“资源路径”文件夹在外部浏览器中运行html文件,下面是我使用的代码 Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse("file:///android_assets/mobile/index.html"));
Intent browserIntent = new Intent("android.intent.action.VIEW",
Uri.parse("file:///android_assets/mobile/index.html"));
startActivity(browserIntent);
可以这样做吗?首先,使用
file:///android_asset/mobile/index.html
。文件系统上的目录是assets/
(复数),而URL格式使用assets
(单数)
其次,您不能在您的一项资产上打开Web浏览器。您需要:
ContentProvider
为其提供服务,并在生成的content://
路径上启动默认浏览器第三种可能是您自己使用
WebView
小部件显示内容。首先,使用file:///android_asset/mobile/index.html
。文件系统上的目录是assets/
(复数),而URL格式使用assets
(单数)
其次,您不能在您的一项资产上打开Web浏览器。您需要:
ContentProvider
为其提供服务,并在生成的content://
路径上启动默认浏览器第三种可能是您自己使用
WebView
小部件显示内容。您能在此处提供异常吗?java.lang.RuntimeException:无法启动activity ComponentInfo android.content.ActivityNotFoundException:找不到可处理意图的活动{act=android.intent.action.VIEW dat=file:///android_assets/mobile/index.html }您可以在此处提供异常吗?java.lang.RuntimeException:无法启动activity ComponentInfo android.content.ActivityNotFoundException:未找到可处理Intent的活动{act=android.Intent.action.VIEW dat=file:///android_assets/mobile/index.html }