安卓4.0 ICS配售闪存的WebView到全屏来电hideAll方法?全屏、闪存、方法、ICS

2023-09-13 01:49:17 作者:黑白昼夜循环ゝ

我刚才一直在做一些研究试图更新我的应用程序的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

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