How to check if current user is logged in android

前端 未结 5 1011
日久生厌
日久生厌 2020-12-14 23:24

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

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 00:03

    According to this:

    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.
       // ...
    }
    

提交回复
热议问题