Commit 39649508 authored by Varun Patil's avatar Varun Patil

Add delay to webview load

parent 4750bea1
...@@ -66,10 +66,12 @@ public class LoginActivity extends AppCompatActivity { ...@@ -66,10 +66,12 @@ public class LoginActivity extends AppCompatActivity {
WebView webview = (WebView) findViewById(R.id.login_webview); WebView webview = (WebView) findViewById(R.id.login_webview);
webview.loadUrl("file:///android_asset/login.html"); webview.loadUrl("file:///android_asset/login.html");
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.setWebViewClient(new WebViewClient() { webview.setWebViewClient(new WebViewClient() {
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
/* Capture redirect */ /* Capture redirect */
if (url.startsWith(redirectUri)) { if (url.startsWith(redirectUri)) {
/* Show progress dialog */ /* Show progress dialog */
...@@ -94,7 +96,12 @@ public class LoginActivity extends AppCompatActivity { ...@@ -94,7 +96,12 @@ public class LoginActivity extends AppCompatActivity {
} }
/* Load URL */ /* Load URL */
view.loadUrl(url); view.postDelayed(new Runnable() {
@Override
public void run() {
view.loadUrl(url);
}
}, 500);
return false; return false;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment