修复支付弹窗问题

This commit is contained in:
hch 2023-12-07 17:31:08 +08:00
parent 32d0fe497d
commit 48886374d5

View File

@ -17,6 +17,8 @@ import android.webkit.WebView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.facebook.appevents.AppEventsConstants; import com.facebook.appevents.AppEventsConstants;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.GoogleUtils; import com.yunbao.common.utils.GoogleUtils;
@ -40,6 +42,8 @@ public class GoogleFragment extends Fragment {
GoogleUtils googleUtils; GoogleUtils googleUtils;
boolean isGoogleService = true;
public GoogleFragment() { public GoogleFragment() {
} }
@ -59,13 +63,20 @@ public class GoogleFragment extends Fragment {
rlWebview = (WebView) view.findViewById(R.id.rlWebview); rlWebview = (WebView) view.findViewById(R.id.rlWebview);
Log.e("ttt", url); Log.e("ttt", url);
rlWebview.loadUrl(url); rlWebview.loadUrl(url);
initGooglePay();
new Thread() { // 验证是否已在此设备上安装并启用Google Play服务以及此设备上安装的旧版本是否为此客户端所需的版本
@Override int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getActivity());
public void run() { if (code == ConnectionResult.SUCCESS) {
adid = googleUtils.getAdid(); isGoogleService = true;
} // 支持Google服务
}.start(); initGooglePay();
new Thread() {
@Override
public void run() {
adid = googleUtils.getAdid();
}
}.start();
}
WebSettings webSettings = rlWebview.getSettings(); WebSettings webSettings = rlWebview.getSettings();
webSettings.setDomStorageEnabled(true); webSettings.setDomStorageEnabled(true);