Fixed view hiding not working properly.

This commit is contained in:
KhatibFX 2023-04-07 22:06:05 +08:00
parent e0c5c8ff5c
commit d3067e4162
1 changed files with 6 additions and 2 deletions

View File

@ -541,8 +541,12 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
} }
ViewGroup vg = (ViewGroup) (webView.getParent()); ViewGroup vg = (ViewGroup) (webView.getParent());
if (vg != null) { if (vg != null) {
//Modified view removal to try and fix a crash // Modified view removal to try and fix a crash
webView.visibility = View.GONE; for (int i = 0; i < vg.getChildCount(); i++) {
View v = vg.getChildAt(i);
v.visibility = View.GONE;
}
// instead of using
// vg.removeView(webView); // vg.removeView(webView);
} }
webView.setWebChromeClient(new WebChromeClient()); webView.setWebChromeClient(new WebChromeClient());