| | |
| | | import com.dayu.pipirrapp.bean.db.LoginBean; |
| | | import com.dayu.pipirrapp.dao.DaoSingleton; |
| | | import com.dayu.pipirrapp.databinding.ActivitySplashScreenBinding; |
| | | import com.dayu.pipirrapp.utils.CommonData; |
| | | import com.dayu.pipirrapp.utils.CommonKeyName; |
| | | import com.dayu.pipirrapp.utils.SharedPreferencesHelper; |
| | | |
| | | /** |
| | |
| | | binding = ActivitySplashScreenBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | new Handler().postDelayed(() -> { |
| | | LoginBean loginBean = DaoSingleton.getInstance(SplashScreenActivity.this).loginDao().findFirst(); |
| | | String token = SharedPreferencesHelper.getInstance(SplashScreenActivity.this).get(CommonData.Token, ""); |
| | | if (loginBean != null && !TextUtils.isEmpty(token)) { |
| | | startMainActivity(); |
| | | MyApplication.myApplication.token = token; |
| | | } else { |
| | | startLoginActivity(); |
| | | } |
| | | // LoginBean loginBean = DaoSingleton.getInstance(SplashScreenActivity.this).loginDao().findFirst(); |
| | | // String token = SharedPreferencesHelper.getInstance(SplashScreenActivity.this).get(CommonKeyName.Token, ""); |
| | | // if (loginBean != null && !TextUtils.isEmpty(token)) { |
| | | // startMainActivity(); |
| | | // MyApplication.myApplication.token = token; |
| | | // MyApplication.myApplication.userId = loginBean.getUserID(); |
| | | // } else { |
| | | // startLoginActivity(); |
| | | // } |
| | | Intent intent = new Intent(this, OrderDealActivity.class); |
| | | startActivity(intent); |
| | | SplashScreenActivity.this.finish(); |
| | | }, 1000); |
| | | } |