flash file not displaying on the screen?

狂风中的少年 提交于 2019-12-24 04:54:09

问题


I am using webview control for displaying a flash .swf file in my application. when i run the app screen displaying whole white scrren.

Here it is my code,

   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);     


}      
}

and the xml file contains webview control

<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>

and also i added the Android:hardwareAccelerated:"true" in the manifest file.

i am still stuck with the white screen.

Please help.

Thanks in advance.


回答1:


Have you tried embeding the .swf file in an html file and load this html ?



来源:https://stackoverflow.com/questions/10142445/flash-file-not-displaying-on-the-screen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!