Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] how to hardcode url navigation webview

OP viv_jen

23rd April 2014, 11:16 AM   |  #1  
viv_jen's Avatar
OP Senior Member
Flag Mumbai
Thanks Meter: 134
 
389 posts
Join Date:Joined: Aug 2011
More
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
23rd April 2014, 03:16 PM   |  #2  
Masrepus's Avatar
Senior Member
Thanks Meter: 80
 
707 posts
Join Date:Joined: Feb 2013
More
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: [ View ]
Post Reply Subscribe to Thread

Tags
android, urlredirection, webview
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes