私はアンドロイドが初めてです。フラッシュプレーヤーをWebビューにロードするための簡単なアプリを作成しました。私のフラッシュプレーヤーには、アセットフォルダーの2つのフォルダーに保存されているプレゼンテーションが含まれています1はデータフォルダー2はプレーヤーで、私のplayer.htmlです
アプリはタブレットにインストールされ、実行を開始しますが、読み込みバーが途中まで到達すると、完了せずにそのままになります。
これは私のActivity Javaファイルです
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity
{
final Activity activity = this;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginsEnabled(true);
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
activity.setTitle("Loading...");
activity.setProgress(progress * 100);
if(progress == 100)
activity.setTitle(R.string.app_name);
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
{
// Handle the error
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
webView.loadUrl("file:///android_asset/player.html");
}
}
そして、ここに私のXMLファイルがあります
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:orientation="vertical"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="HTML in WEB View"
tools:context="MainActivity" />
<WebView
android:id="@+id/webView"
android:hardwareAccelerated="true"
android:layout_width="match_parent"
android:layout_height="match_parent" />
マニフェストでハードウェア アクセラレーションを true に設定しています
誰かが問題がどこにあるのか教えてください。
私の仮定は、アセットフォルダーへのファイルアクセスを許可する必要がありますか? すべてのファイルをサブフォルダーのないアセット フォルダーに配置する必要がありますか? Webview は、Flash がファイルにアクセスできるようにする非表示のポップアップ ウィンドウをクリックするのを待っていますか?
よろしくお願いいたします。