0

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

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?

Any help is greatly appreciated.

Best

David

user1195403
  • 1
  • 1
  • 2

3 Answers3

0

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);
                    }
                }
            }
        });
datu-puti
  • 1,306
  • 14
  • 33
0

See my answer over here:

flash player crashes when trying to enter fullscreen mode android 4.0

This is how I solved this issue. Hope it helps.

Community
  • 1
  • 1
maddesa
  • 1,014
  • 7
  • 18
  • Hey yes I fixed that crash found that earlier in the piece. My issue now is when you put the flash into full screen that ICS class makes the webview View, View.GONE.... – user1195403 Feb 10 '12 at 21:08
0

I solved the mentioned problem by overriding the onShowCustomView method. Please try if this works for you. Below is my code.

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) {                  
                    base.addView(view, new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.FILL_PARENT,
                    ViewGroup.LayoutParams.FILL_PARENT,
                    Gravity.CENTER));                   
                    base.setVisibility(View.VISIBLE);
                }
            }
        }

    });
rmtheis
  • 5,992
  • 12
  • 61
  • 78
Simon
  • 9
  • 1