flash文件没有显示在屏幕上?

时间:2012-04-13 14:11:37

标签: android flash

我正在使用webview控件在我的应用程序中显示flash .swf文件。   当我运行应用程序屏幕显示整个白色scrren。

这是我的代码,

   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”  在清单文件中。

我仍然坚持白屏。

请帮忙。

提前致谢。

1 个答案:

答案 0 :(得分:0)

您是否尝试在 html 文件中嵌入 .swf 文件并加载此HTML?