我在加载android模拟器中的交互式SWF文件时出现问题。我使用2.3.1 AVD。在Android中加载swf文件时出现问题
这是代码:
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>
现在的问题是,当我运行该项目,它会给一个方框状中心右侧的三维尺寸:
我也试图改变不同的SWF文件,但无法得到适当的解决方案。
任何人都可以帮助我吗?谢谢。
是您正确的链接,例如如果您添加一个链接到file:///android_asset/FL.swf的标签,您可以下载该文件吗? –
@niky:你没有答案的部分原因是,除了“谁能帮助我?”之外,你没有提出任何问题。 – CommonsWare
雅其totaly正确,我已经检查了很多时间 –