开发者

SharedPreferences to keep session

开发者 https://www.devze.com 2023-01-25 17:01 出处:网络
I make an app with some activities. The first is the login. If I lo开发者_JAVA技巧gin correctly, I pass to the second activity, and I want download a stream (like twitter), but I cannot keep the sessi

I make an app with some activities. The first is the login. If I lo开发者_JAVA技巧gin correctly, I pass to the second activity, and I want download a stream (like twitter), but I cannot keep the session.

I saved user & pass in sharedpreferences, how can i keep the session througt all activities?


You have to get the data back from shared preferences.

Careful though using shared prefs for logins. You would have to encrypt it. I can not remember if this is possible with shared prefs.

Shared preferences is generally not the best solution when it comes to logins.

0

精彩评论

暂无评论...
验证码 换一张
取 消