[Q] how to hardcode url navigation webview

Search This thread

viv_jen

Senior Member
Aug 9, 2011
412
138
Mumbai
ASUS ZenFone 8
Im using a webview to display a website.
The page iam opening using loadurl method is the login page, on successful login redirection occurs to a particular page .
I want to skip that page i.e dont want to show that page rather show the webpage after that

eg If my webview starts with webpage A
on login success it shows webpage B
and then next page is webpage C
i want after Login success in page A it should go automatically to webpage C

current code im using
Code:
public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (Uri.parse(url).getHost().trim().equals("https://www.test.com")) {
web.loadUrl("https://www.test1.com");
            }
            return false;
    }

so any tips/pointers as to how i do this? thanks
 

Masrepus

Senior Member
Feb 12, 2013
767
99
Maybe you load the webview in a background task without updating the ui and then execute the test method you mentioned above and only update the webview ui once you determined whether you must override the url. Not sure if that is possible but maybe it is

---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------

4d 61 73 72 65 70 75 73 20 66 74 77

Gesendet von Tapatalk
 
  • Like
Reactions: viv_jen

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Maybe you load the webview in a background task without updating the ui and then execute the test method you mentioned above and only update the webview ui once you determined whether you must override the url. Not sure if that is possible but maybe it is

    ---------------------------------
    Phone : Nexus 4
    OS:
    Pure KitKat 4.4.2 stock, no root, no mods
    ---------------------------------

    4d 61 73 72 65 70 75 73 20 66 74 77

    Gesendet von Tapatalk