gpt4 book ai didi

android - 将 Flash 文件加载到 WebView 时出现问题

转载 作者:行者123 更新时间:2023-11-29 15:29:30 24 4
gpt4 key购买 nike

我正在尝试将一个简单的 swf 加载到嵌入的 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");

}

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

我没有看到这段代码有什么问题......但我的 WebView 仍然显示黑色

通过检查 LogChat 我发现了这个错误:

11-30 12:46:32.170: E/libEGL(13839): call to OpenGL ES API with no current context (logged once per thread)

那是什么?我该如何解决?

我正在使用这个瑞士法郎:http://www.tizag.com/pics/example.swf

我正在使用 Motorola Xoom - Android 3.1。

谁能帮我解决这个问题?

最佳答案

我只是找到我自己的答案!!!!您应该在 list 中的应用程序中激活属性 android:hardwareAccelerated ,如下所示:

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="true" >

关于android - 将 Flash 文件加载到 WebView 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8328596/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com