Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,470 Members 41,260 Now Online
XDA Developers Android and Mobile Development Forum

[Q] how to hardcode url navigation webview

Tip us?
 
viv_jen
Old
#1  
viv_jen's Avatar
Senior Member - OP
Thanks Meter 132
Posts: 389
Join Date: Aug 2011
Location: Mumbai
Default [Q] how to hardcode url navigation webview

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

Quote:
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
Old
#2  
Masrepus's Avatar
Senior Member
Thanks Meter 73
Posts: 660
Join Date: Feb 2013
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
The Following User Says Thank You to Masrepus For This Useful Post: [ Click to Expand ]
Tags
android, urlredirection, webview
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes