Update CustomWebView.java

pull/123/head
FongMi 3 years ago
parent c067b1cd42
commit 6cfcc21325
  1. 8
      app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWebView.java

@ -123,24 +123,24 @@ public class CustomWebView extends WebView {
String cookie = CookieManager.getInstance().getCookie(url);
if (!TextUtils.isEmpty(cookie)) news.put("cookie", cookie);
for (String key : headers.keySet()) if (keys.contains(key.toLowerCase())) news.put(key, headers.get(key));
onSuccess(news, url);
onParseSuccess(news, url);
}
public void stop(boolean error) {
stopLoading();
loadUrl("about:blank");
App.removeCallbacks(timer);
if (error) onError();
if (error) onParseError();
else callback = null;
}
private void onSuccess(Map<String, String> news, String url) {
private void onParseSuccess(Map<String, String> news, String url) {
if (callback != null) callback.onParseSuccess(news, url, from);
App.post(() -> stop(false));
callback = null;
}
private void onError() {
private void onParseError() {
if (callback != null) callback.onParseError();
callback = null;
}

Loading…
Cancel
Save