开发者

SharedPreferences to keep session

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜