1

I'm trying to do a webview based application for this website to show it in a mobile application.

when I put any different site the application work great, but in this specific site never show the second page when I clicked in the button to go to the desk page.
However, I put a Log statement in the onPageFinished method and log that the page is loaded completely.

My Code Here

final WebView myWebView = (WebView) rootView.findViewById(R.id.webview);
        myWebView.getSettings().setJavaScriptEnabled(true);


        myWebView.setWebViewClient(new WebViewClient() {
            @Override
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                Toast.makeText(getActivity(), "Oh no! " + description, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPageFinished(WebView view, String url) {
                Log.d("WEBSITE", "Page Loaded.");

            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                Log.d("WEBSITE", url);
                myWebView.loadUrl(url);

                return false;
            }


        });

        myWebView.loadUrl("https://demo.frappecloud.com/");
NickF
  • 5,637
  • 12
  • 44
  • 75
geekroot
  • 11
  • 1

1 Answers1

0

I believe the problem is with your shouldOverrideUrlLoading. If you check the documentation you will see that :

This method is not called for requests using the POST "method"

When you are submitting the Form, you are making a POST request, which is basically ignored.

Here is the link: WebViewClient

Also check this reference where it says how you could load a URL with POST data: LOAD A POST REQUEST INTO A WEBVIEW IN ANDROID

Consider checking this thread: Android - how to intercept a form POST

Community
  • 1
  • 1
ZakiMak
  • 2,072
  • 2
  • 17
  • 26