The following code reproduces the bug. As stated above, to reproduce the
error the Android System Webview (Beta) version needs to be installed and
chosen as primary WebView in Settings. This version will replace the stable
release very soon, so time is of the essence

Notice that when navigating back to the previous form, the BrowserComponent
is blank on Android (doesn't always happen, might need to try 2 or 3 times
to see it). To test, just call testMethod() from anywhere

public void testMethod()
        {
            Form previous = Display.getInstance().getCurrent();
Form welcomeForm = new Form("Test", new BorderLayout());
                BrowserComponent tstBrowser = new BrowserComponent();
                tstBrowser.setURL("https://www.google.com";);
                welcomeForm.add(BorderLayout.CENTER,tstBrowser);

welcomeForm.getToolbar().addMaterialCommandToRightBar("GO_FORWARD",
FontImage.MATERIAL_ARROW_FORWARD, ee -> {
                    testMethod2();
                });
                welcomeForm.show();
        }
        public void testMethod2(){
            Form previous = Display.getInstance().getCurrent();
Form welcomeForm = new Form("Test", new BorderLayout());

welcomeForm.getToolbar().addMaterialCommandToLeftBar("ShowBack",
FontImage.MATERIAL_ARROW_BACK, ee -> {
                    previous.showBack();
                });
                welcomeForm.show();
        }


On Sat, 13 Mar 2021 at 12:30, Javier Anton <[email protected]> wrote:

> Upcoming bug in Android WebView (currently found in Beta) that affects CN1
> apps hosting a BrowserComponent
>
> I have filed this issue with Chromium project
> https://bugs.chromium.org/p/chromium/issues/detail?id=1187828
>
> The bug isn't yet present in stable releases of Android Webview
> (89.0.4389.69) but has already made its way from Dev and Canary to Beta
> (90.0.4430.19)
>
> Basically, a CN1 form that contains a BrowserComponent will lose its
> browsercomponent when shown back. Strangely, it comes back to life if you
> open a side Sheet and tap on it (see attached, sometimes it requires
> opening a Sheet multiple times)
>
> I would normally think that this is a problem in my code but I
> -Tested extensively
> -Verified that the issue only happens when upgrading WebView
>
> Now, I filed the issue with Chromium using the word "Activities" in place
> of Form even though this isn't very correct as CN1 is a single activity. I
> did this to make it easier to understand, but please feel free to
> contribute if you think you can hint at something that will make it easier
> to solve this
>
> Thanks
>
>
> Javier
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAG90yJ3RbAL7i%3D8f8ZV0YgnD57myO1RnbG5O1D0RUwSWofuuiw%40mail.gmail.com.

Reply via email to