| | |
| | | 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(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); |
| | | try { |
| | | 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(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | startLoginActivity(); |
| | | } |
| | | SplashScreenActivity.this.finish(); |
| | | // Intent intent = new Intent(this, OrderDealActivity.class); |
| | | // startActivity(intent); |
| | | // SplashScreenActivity.this.finish(); |
| | | }, 1000); |
| | | } |
| | | |