How to maintain session
Now i am working one json applivation.I am passing url in http they will reply one json.I getting json and display listview.These working fine but session will not maintain long live.pls help me how to maintain session l开发者_如何学编程ong live.......
public class Session {
private static String sessionId;
private static String userRole;
public static void setSessionId(String sessionId) {
Session.sessionId = sessionId;
}
public static String getSessionId() {
return sessionId;
}
}
Use this class and import it in every other activity. You can define your own functions to maintain your specific session data. "STATIC" is the key.
Hope it helps !!
精彩评论