How to maintain session in android?

后端 未结 10 2006
轻奢々
轻奢々 2020-11-29 19:35

Can anybody tell me how to maintain session for a user login. For example when the user sign- in to an application they have to be signed in unless the user logouts or unin

10条回答
  •  孤城傲影
    2020-11-29 20:13

    You can obtain that behaivour in a few different ways, the one I prefer is setting a flag in the shared prefs. whe a user logs in an check it when the app is started if you get the default value the user is not loggend, else you should have your flag (i use the user name) set and avoid the log-in section.

提交回复
热议问题