【问题标题】:Loading Flash in a Webview, I'm lost在 Webview 中加载 Flash,我迷路了
【发布时间】:2014-03-10 19:02:55
【问题描述】:

我正在尝试加载此特定网站:http://www.4maktoob.com/

在 android webview 中,但我得到的只是一个空白页面。这是我的代码:

final WebView myWebView = (WebView)this.findViewById(R.id.webViewx1);
        // Set up an instance of SystemUiHider to control the system UI for
        // this activity.
        myWebView.getSettings().setJavaScriptEnabled(true);
        myWebView.getSettings().setDefaultTextEncodingName("utf-8");
        myWebView.getSettings().setLoadWithOverviewMode(true);
        myWebView.getSettings().setUseWideViewPort(true);
        myWebView.setWebChromeClient(new WebChromeClient());
        myWebView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        myWebView.loadUrl("http://www.4maktoob.com/");

【问题讨论】:

  • 您使用什么 API 在 webview 中运行 flash?使用最新的 API

标签: java android flash webview


【解决方案1】:

1 - 您需要在设备上安装 Adob​​e Flash 才能加载此网站。除非您安装了它,否则它不会加载到 WebView 中。

2 - 如果您安装了 Adob​​e Flash,则需要在 WebView 中启用它,如下所示(注意:Android 4.4 及更高版本的 WebView 已完全禁用 Adob​​e Flash 支持):: p>

WebView myWebView = (WebView) findViewById(R.id.myWebView);
myWebView.getSettings().setPluginState(PluginState.ON); //this is deprecated in API 19

这将允许 Flash 插件加载到 WebView 中。但是,flash 有很多错误,不能保证在更高的 API 级别上工作。我发现 Flash 在 4.2 或 4.3 上不能很好地工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-19
    • 2011-04-24
    • 2022-01-23
    • 2015-02-07
    • 1970-01-01
    相关资源
    最近更新 更多