安卓4.0 ICS配售闪存的WebView到全屏来电hideAll方法? [英] Android ICS 4.0 Placing Flash WebView into full screen calls hideAll Method?

查看:142
本文介绍了安卓4.0 ICS配售闪存的WebView到全屏来电hideAll方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚才一直在做一些研究试图更新我的应用程序的ICS。当通过HTML或长pressing 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

<一个href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.0.1_r1/android/webkit/PluginFullScreenHolder.java#PluginFullScreenHolder.setContentView%28android.view.View%29"相对=nofollow> 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?

任何帮助是极大的AP preciated。

Any help is greatly appreciated.

最佳

大卫

推荐答案

使用西蒙的回答为基础,我得到它的工作。我有一个的FrameLayout 的WebView的父。这是基地西蒙的答案。在的onCreate 我建立web视图,并将其添加到我的的FrameLayout 这就是所谓的 mWebContainer

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);
                    }
                }
            }
        });

这篇关于安卓4.0 ICS配售闪存的WebView到全屏来电hideAll方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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