在android中加载swf文件时出现问题

我在 Android模拟器中加载交互式SWF文件时遇到问题.我使用2.3.1 AVD.

这是代码:

package com.androidpeople.view;

    import android.app.Activity;
    import android.os.Bundle;
    import android.webkit.WebView;

    public class WebViewExample extends Activity {

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            /*WebView webView = (WebView) findViewById(R.id.webview);
            webView.getSettings().setJavaScriptEnabled(true);
            webView.loadUrl("http://www.androidpeople.com");

            webView.setWebViewClient(new HelloWebViewClient());*/

            String html =
                "<object width=\"550\" height=\"400\"> <param name=\"movie\" value=\"file:///android_asset/FL.swf\"> <embed src=\"file:///android_asset/FL.swf\" width=\"550\" height=\"400\"> </embed> </object>";
                String mimeType = "text/html";
                String encoding = "utf-8";

            WebView wv=(WebView) findViewById(R.id.webview);
            wv.getSettings().setJavaScriptEnabled(true);
            wv.getSettings().setPluginsEnabled(true);
            wv.loadDataWithBaseURL("null",html,mimeType,encoding,"");
            wv.setWebViewClient(new HelloWebViewClient());



        }
    }


package com.androidpeople.view;

import android.webkit.WebView;
import android.webkit.WebViewClient;

public class HelloWebViewClient extends WebViewClient {

@Override
public boolean shouldOverrideUrlLoading(WebView view,String url) {
    view.loadUrl(url);
    return true;
}

}

清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.androidpeople.view"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".WebViewExample"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>
<uses-sdk android:minSdkVersion="5" />

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

</manifest>

现在的问题是,当我运行项目时,它将在中心右侧3D维度给出一个框,如:

我也尝试更改不同的SWF文件但无法获得正确的解决方案.

谁能帮我?谢谢.

解决方法

更换

wv.loadDataWithBaseURL("null","");

wv.loadData(html,"");
wv.getSettings().setJavaScriptEnabled(true);

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...