判断用户是否登录

if (checkLogin()) {
    refelash();
    setPro();
} else {
    //如果没有登录,直接跳转登录界面
    startLogin();
}

private boolean checkLogin() {

        SharedPreferences sp = getSharedPreferences("Login", MODE_PRIVATE);
        boolean isLogin = sp.getBoolean("isLogin", false);
        return isLogin;
    }

猜你喜欢

转载自blog.csdn.net/ydc0128/article/details/80926022
今日推荐