List of usage examples for android.net UrlQuerySanitizer parseUrl
public void parseUrl(String url)
From source file:Main.java
static void paramLoader(WebView view, String url) { UrlQuerySanitizer sanitizer = new UrlQuerySanitizer(); sanitizer.setAllowUnregisteredParamaters(true); sanitizer.parseUrl(url); String param = sanitizer.getValue("pageload"); if (param != null) { switch (param) { case "composer": view.loadUrl(//from w w w .j ava 2s. c om "javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_overview%22%5D').click()%7Dcatch(_)%7B%7D%7D)()"); break; case "composer_photo": view.loadUrl( "javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_photo%22%5D').click()%7Dcatch(_)%7B%7D%7D)()"); break; case "composer_checkin": view.loadUrl( "javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_location%22%5D').click()%7Dcatch(_)%7B%7D%7D)()"); break; case "composer_top": view.scrollTo(0, 0); break; default: break; } } }
From source file:com.karura.framework.utils.UrlUtils.java
public static UrlQuerySanitizer sanitizeQuery(String query, String[] parameters) { UrlQuerySanitizer sanitizer = new UrlQuerySanitizer(); sanitizer.registerParameters(parameters, UrlQuerySanitizer.getSpaceLegal()); sanitizer.parseUrl(query); return sanitizer; }