【问题标题】:flash file not displaying on the screen?flash文件不显示在屏幕上?
【发布时间】: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" 在清单文件中。

我仍然卡在白屏上。

请帮忙。

提前致谢。

【问题讨论】:

    标签: android flash


    【解决方案1】:

    您是否尝试过将 .swf 文件嵌入到 html 文件中并加载此 html?

    【讨论】:

    • 当时我发布这个 Android 仍然有闪存。但是现在这个选项已经没有用了。
    猜你喜欢
    • 2012-01-14
    • 2021-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多