简体   繁体   English

在android播放Flash.swf文件?

[英]Playing Flash .swf file in android?

I have this code:我有这段代码:

         package flash.play;

       import android.app.Activity;
       import android.os.Bundle;
        import android.os.Environment;
     import android.webkit.WebView;


     public class flashplay extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);



    WebView wv=(WebView) findViewById(R.id.wv);
    wv.getSettings().setJavaScriptEnabled(true);
    wv.getSettings().setPluginsEnabled(true);
    String url ="file:///android_asset/abcd.swf";



    wv.getSettings().setPluginsEnabled(true);

    wv.loadUrl(url);

}
 }

But I am getting just a white screen on emulator Can anyone please help me play this file on Webview?但是我在模拟器上只有一个白屏 任何人都可以帮我在 Webview 上播放这个文件吗?

Please add this to your AndroidMainfest.xml请将此添加到您的 AndroidMainfest.xml

android:hardwareAccelerated = "true" android:硬件加速=“真”

You should test it on a device.您应该在设备上对其进行测试。 not on emulator不在模拟器上

What I did with mine is I created an html file and call my html file in WebView. inside my html file I use swfobject to load my swf file.我对我所做的是我创建了一个 html 文件,并在 WebView 中调用我的 html 文件。在我的 html 文件中,我使用 swfobject 加载我的 swf 文件。 I hope this helps someone.我希望这可以帮助别人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM