【发布时间】:2012-04-13 22:24:25
【问题描述】:
我正在使用 webview 控件在我的应用程序中显示一个 flash .swf 文件。 当我运行显示全白屏幕的应用程序屏幕时。
这是我的代码,
public class flash extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.main);
String url ="file:///android_asset/beautiful.swf";
WebView webview = (WebView) findViewById(R.id.flash_webview);
webview.getSettings().setPluginsEnabled(true);
webview.getSettings().setAllowFileAccess(true);
webview.loadUrl(url);
}
}
xml文件包含webview控件
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/flash_webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</RelativeLayout>
我还添加了 Android:hardwareAccelerated:"true" 在清单文件中。
我仍然卡在白屏上。
请帮忙。
提前致谢。
【问题讨论】: