Guest User

Untitled

a guest
Jan 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
  2.  
  3. public class MainActivity extends DroidGap {
  4.  
  5. @Override
  6. public void onCreate(Bundle savedInstanceState) {
  7. super.onCreate(savedInstanceState);
  8. super.setIntegerProperty("loadUrlTimeoutValue", 60000);
  9.  
  10. this.init();
  11.  
  12. this.appView.clearCache(true);
  13. this.appView.clearHistory();
  14.  
  15. this.appView.setWebViewClient(new CordovaWebViewClient(this, this.appView) {
  16.  
  17. @Override
  18. public boolean shouldOverrideUrlLoading(WebView view, String url) {
  19.  
  20. if(url.contains("app://")) {
  21. url = url.replace("app://", "");
  22. Log.d("DEBUG", url);
  23.  
  24. // DO STUFF
  25.  
  26. return true;
  27. } else {
  28. //view.loadUrl(url);
  29. return super.shouldOverrideUrlLoading(view, url);
  30. }
  31.  
  32. }
  33.  
  34. });
  35.  
  36. super.loadUrl("file:///android_asset/www/index.html");
  37. }
  38.  
  39. }
Add Comment
Please, Sign In to add comment