package com.qxcm.qxlive; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import androidx.annotation.Nullable; import com.qxcm.moduleutil.activity.BaseAppCompatActivity; import com.qxcm.moduleutil.activity.BaseMvpActivity; import com.qxcm.moduleutil.base.CommonAppContext; import com.qxcm.moduleutil.dialog.PolicyDialog; import com.qxcm.moduleutil.utils.SpUtil; import com.qxcm.qxlive.databinding.ActivityLaunchPageBinding; public class LaunchPageActivity extends BaseAppCompatActivity { private Handler handler; // public PhoneNumberAuthHelper phoneNumberAuthHelper; // private TokenResultListener tokenResultListener; private boolean canOnePass; private boolean isCanOnePass = true; private String city1=""; @Override protected void initData() { handler = new Handler(); // 定义一个Runnable Runnable runnable = new Runnable() { @Override public void run() { initLogin(); } }; if (SpUtil.isAgreePolicy()) { // //延迟1.5秒执行 handler.postDelayed(runnable, 2500); } else { PolicyDialog policyDialog = new PolicyDialog(this); policyDialog.setCancelable(false); policyDialog.setCanceledOnTouchOutside(false); policyDialog.setPolicyClickListener(new PolicyDialog.PolicyClickListener() { @Override public void policyAgree() { SpUtil.completeAgreePolicy(); CommonAppContext.getInstance().initialization(); initLogin(); } @Override public void policyExit() { finish(); } }); policyDialog.show(); } } @Override protected void initView() { } private void initLogin() { startActivity(new Intent(this, PasswordLoginActivity.class)); finish(); } @Override protected int getLayoutId() { return R.layout.activity_launch_page; } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!this.isTaskRoot()) { Intent intent = getIntent(); if (intent != null) { String action = intent.getAction(); if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) { finish(); return; } } } } }