| | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | | |
| | | import com.moral.andbrickslib.utils.NetworkUtil; |
| | | import com.moral.andbrickslib.utils.StatusBarUtil; |
| | | import com.moral.yunfushao.MainActivity; |
| | | import com.moral.yunfushao.MainApp; |
| | | import com.moral.yunfushao.R; |
| | | import com.moral.yunfushao.base.BaseActivity; |
| | | import com.moral.yunfushao.utils.SharedPreferencesUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | int type = SharedPreferencesUtil.getUtil(this).getLoginInfo().getLogin_type(); |
| | | |
| | | if (!NetworkUtil.isAvailable(this)) { |
| | | return; |
| | | } |
| | | switch (type) { |
| | | case 1: |
| | | //手机登陆 |
| | | goHome(); |
| | | break; |
| | | case 2: |
| | | //微信登陆 |
| | | sendReq(); |
| | | break; |
| | | case -1: |
| | | Intent intent = new Intent(this, LoginActivity.class); |
| | | startActivity(intent); |
| | | default: |
| | | } |
| | | protected void onStop() { |
| | | super.onStop(); |
| | | finish(); |
| | | } |
| | | |
| | | private void goHome() { |
| | | if (!TextUtils.isEmpty(MainApp.userId)) { |
| | | Intent intent = new Intent(this, MainActivity.class); |
| | | startActivity(intent); |
| | | } else { |
| | | Intent intent = new Intent(this, LoginActivity.class); |
| | | startActivity(intent); |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(2000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Intent intent = new Intent(this, LoginActivity.class); |
| | | startActivity(intent); |
| | | } |
| | | } |