package hf.lskj.com.carstockcount.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;

import hf.lskj.com.carstockcount.MyApplication;
import hf.lskj.com.carstockcount.db.User;
import hf.lskj.com.carstockcount.db.UserDaoUtils;

public class LaunchActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        UserDaoUtils userDaoUtils=new UserDaoUtils(this);
        User current = userDaoUtils.loadCurrent();
        if (current==null|| TextUtils.isEmpty(current.getLoginId())){
            startActivity(new Intent(this, LoginActivity.class));
            finish();
        }else {
            MyApplication.currentUser=current;
            startActivity(new Intent(this, MainActivity.class));
            finish();
        }
    }


}
