Atul Singh
Atul Singh

Reputation: 185

How to use session management (using shared preference) in more then one android activity (different activity for different account)

I want to create session management in android for more then one activity.

i read session management on this site http://www.androidhive.info/2012/08/android-session-management-using-shared-preferences/

how to create above code for more then one Activity? From above tutorial i can understand for one activity only.

Upvotes: 0

Views: 132

Answers (1)

Febi M Felix
Febi M Felix

Reputation: 2839

You can use the same logic explained in that link. While using Activities, save the preference data(logged in or not boolean etc) when user leaves or enter the activity class. Like in onPause method.

Upvotes: 1

Related Questions