Android ICS 4.0 将 Flash WebView 放入全屏调用 hideAll 方法? [英] Android ICS 4.0 Placing Flash WebView into full screen calls hideAll Method?

查看:10
本文介绍了Android ICS 4.0 将 Flash WebView 放入全屏调用 hideAll 方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚进行了一些调查,试图更新我的 ICS 应用程序.当我通过 html 或长按 Flash 内容将我的 WebView Flash 内容全屏显示时,整个内容在寻找 Android ICS 源后消失了,我在

I have just been doing some investigating trying to update my app for ICS. When placing my WebView flash content into fullscreen via html or long pressing flash content the whole content just disappears after hunting around the Android ICS source I found this in the

android.webkit.PluginFullScreenHolder

PluginFullScreenHolder

public void show() {
    // Other plugins may attempt to draw so hide them while we're active.
    if (mWebView.getViewManager() != null)
        mWebView.getViewManager().hideAll();

    WebChromeClient client = mWebView.getWebChromeClient();
    client.onShowCustomView(mLayout, mOrientation, mCallback);
}

void hideAll() {
    if (mHidden) {
        return;
    }
    for (ChildView v : mChildren) {
        v.mView.setVisibility(View.GONE);
    }
    mHidden = true;
}

它基本上将我的整个 WebView 隐藏在全屏选择中,现在默认浏览器中不会发生这种情况,并且无法访问此方法.我该如何解决这个问题?

Its basically hiding my whole WebView on full screen selection now this does not happen in the default browser and this methods are not accessible. How can I fix this?

非常感谢任何帮助.

最佳

大卫

推荐答案

以 Simon 的答案为基础,我让它开始工作.我有一个 FrameLayout 作为 WebView 的父级.这是西蒙回答的基础.在 onCreate 中,我构建了 webview 并将其添加到名为 mWebContainerFrameLayout 中.

Using Simon's answer as a base, I got it to work. I have a FrameLayout as the parent of the WebView. That is the base in Simon's answer. in onCreate I build the webview and add it to my FrameLayout which is called mWebContainer.

mWebView.setWebChromeClient(new WebChromeClient(){
            public void onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback){
                super.onShowCustomView(view, callback);   
                if(Build.VERSION.SDK_INT >=14) {
                    if (view instanceof FrameLayout) {   
                        mWebContainer.addView(view, new FrameLayout.LayoutParams(
                        ViewGroup.LayoutParams.MATCH_PARENT,
                        ViewGroup.LayoutParams.MATCH_PARENT,
                        Gravity.CENTER));                   
                        mWebContainer.setVisibility(View.VISIBLE);
                    }
                }
            }
        });

这篇关于Android ICS 4.0 将 Flash WebView 放入全屏调用 hideAll 方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆