修复在部分老旧设备上 webview 标题回调异常的问题
This commit is contained in:
@ -15,8 +15,6 @@ import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.gh.base.BaseActivity;
|
||||
import com.gh.common.DefaultJsApi;
|
||||
import com.gh.common.DefaultWebViewUrlHandler;
|
||||
@ -48,6 +46,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@ -270,8 +269,11 @@ public class WebFragment extends NormalFragment {
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
if (leaveWebpageToHandleTitle) {
|
||||
mNavigationTitle = view.getTitle();
|
||||
setNavigationTitle(mNavigationTitle);
|
||||
postDelayedRunnable(() -> {
|
||||
if (isResumed()) {
|
||||
setNavigationTitle(view.getTitle());
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user