Android ICS 4.0 Hosting Flash WebView fullscreen hideAll?

I just did research trying to upgrade my application for ICS. When placing WebView flash content in full screen mode via html or a long press of flash content, all content simply disappears after hunting around the ICS Android source. I found this in

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

It basically hides my entire WebView in full screen, so this does not happen in the browser by default, and these methods are not available. How can i fix this?

Any help is greatly appreciated.

The best

David

0
source share
3 answers

See my answer here:

trying to enter full screen mode of Android 4.0 disables flash player

This is how I solved this problem. Hope this helps.

0
source

I solved this problem by overriding the onShowCustomView method. Try it if it 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); } } } }); 
0
source

Using Simon as a base, I got him to work. I have a FrameLayout as the parent element of a WebView . This is the base in Simon's answer. in onCreate I create a webview and add it to my FrameLayout 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); } } } }); 
0
source

All Articles