Google Chrome ブラウザーでローカル HTML ファイルを解析する必要があります。これを行う方法は、HTMLファイルをSDカードにコピーしてロードすることです。私がやりたいことは、MyProject/assets フォルダーから Chrome ブラウザーで HTML ファイルを開くことです。
現在、URLを介してhtmlをロードしています。HTML をローカルで読み込むと、ページの読み込みが速くなります。これが私が今していることです。
Intent i = new Intent("android.intent.action.MAIN");
i.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main"));
i.addCategory("android.intent.category.LAUNCHER");
i.setData(Uri.parse("http://www.example.com"));
startActivity(i);
私がやりたいことは、このようなものです
Intent i = new Intent("android.intent.action.MAIN");
i.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main"));
i.addCategory("android.intent.category.LAUNCHER");
i.setData(Uri.parse("MyProject/assets/htmlfile.html"));
startActivity(i);