如何检查当前用户是否已登录android [英] How to check if current user is logged in android

查看:90
本文介绍了如何检查当前用户是否已登录android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查当前用户是否已登录android. 我有一个外部数据库,我已成功将其连接到数据库. 我需要检查用户是否已登录

How to check if current user is logged in android. I have an external database, I have successfully connected it to the database. I need to check if the user is logged in or not

如果未登录的用户将显示{注册活动},否则将显示{我的信息活动}

if user not logged will display {register activity} otherwise will display {my info activity}

推荐答案

根据:

要检查用户是否已登录,请调用isConnected().

To check if the user is signed-in, call isConnected().

if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
   // signed in. Show the "sign out" button and explanation.
   // ...
} else {
   // not signed in. Show the "sign in" button and explanation.
   // ...
}

这篇关于如何检查当前用户是否已登录android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆