1
我試圖將一個簡單的swf加載到嵌入的WebView中。將Flash文件加載到WebView中的問題
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView wv = (WebView)findViewById(R.id.web);
WebSettings settings = wv.getSettings();
settings.setPluginState(PluginState.ON);
wv.loadUrl("file:///android_asset/example.swf");
}
的main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/web"/>
</LinearLayout>
我看不出有什麼毛病在此代碼...但是我的網絡視圖顯示黑色
通過檢查,我發現這個LogChat錯誤:
11-30 12:46:32.170: E/libEGL(13839): call to OpenGL ES API with no current context (logged once per thread)
是這樣嗎?我該如何解決它?
我使用這個SWF:http://www.tizag.com/pics/example.swf
我與摩托羅拉XOOM工作 - 的Android 3.1。
任何人都可以幫助這個嗎?
設備是否安裝了閃存? – azharb
是的,問題是,如果我從設備瀏覽器加載http://www.tizag.com/pics/example.swf它工作正常,但從我的webView它沒有... – Chiara