回退WebFragment的修改
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package com.halo.assistant.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -46,10 +45,8 @@ import com.lightgame.utils.Utils;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
@ -100,7 +97,6 @@ public class WebFragment extends NormalFragment {
|
||||
private boolean mIsBackpressRequireConfirmation;
|
||||
private String mBackConfirmationContent;
|
||||
private String mGameName;
|
||||
private List<String> titles = new ArrayList<>();
|
||||
|
||||
private TimeElapsedHelper mTimeElapsedHelper;
|
||||
|
||||
@ -309,11 +305,10 @@ public class WebFragment extends NormalFragment {
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
super.onReceivedTitle(view, title);
|
||||
// title 有可能超出边界
|
||||
if (TextUtils.isEmpty(newsId) && TextUtils.isEmpty(mNavigationTitle) && !mIsTools && mAutoCompletionTitle && !view.getUrl().contains(title)) {
|
||||
if (TextUtils.isEmpty(newsId) && TextUtils.isEmpty(mNavigationTitle) && !mIsTools && mAutoCompletionTitle) {
|
||||
mNavigationTitle = title;
|
||||
setNavigationTitle(mNavigationTitle);
|
||||
}
|
||||
titles.add(title);
|
||||
}
|
||||
});
|
||||
boolean isSecurityCertification = args.getBoolean(KEY_IS_SECURITY_CERTIFICATION, false);
|
||||
@ -390,11 +385,7 @@ public class WebFragment extends NormalFragment {
|
||||
}, true, "H5页面", "退出弹窗");
|
||||
return true;
|
||||
} else if (mWebView.canGoBack()) {
|
||||
mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
mWebView.goBack();
|
||||
titles.remove(titles.size() - 1);
|
||||
String title = titles.remove(titles.size() - 1);
|
||||
setNavigationTitle(title);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user