Added a small improvement to url parsing
This commit is contained in:
parent
1c44ec042f
commit
a27e0ca555
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ public class CustomWebViewClient extends WebViewClient {
|
|||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url.contains(WEB_DOMAIN)) {
|
||||
String lang = url.substring(url.indexOf(PAGE_PREFIX) + PAGE_PREFIX.length(), url.indexOf("."));
|
||||
String lang = url.substring(url.startsWith(PAGE_PREFIX) ? PAGE_PREFIX.length() : 0, url.indexOf("."));
|
||||
String articleName = url.replace(PAGE_PREFIX + lang + WEB_DOMAIN, "")
|
||||
.replaceAll("_", " ");
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue