2011-09-13 29 views

回答

3

由於你的問題非常具有普遍性,所以我只能說「是的,這是可能的」!

這是一個將swf文件嵌入Android應用程序的鏈接。

Load an SWF into a WebView

public class Test3Activity extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     String url ="file:///android_asset/qualibus.swf"; 

     WebView wv=(WebView) findViewById(R.id.webView1); 
     wv.getSettings().setPluginsEnabled(true); 
     wv.loadUrl(url); 
    } 
} 

的main.xml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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/webView1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
</WebView> 
</LinearLayout> 

結果:

Application running and displaying swf in web view

+1

謝謝。非常感謝這個感恩的建議 –

+0

我認爲,在未來,你會看到這個問題:http:// stac koverflow.com/questions/5095977/screen-blinking-when-using-a-webview-with-flash閃光燈不完全完美... –