Georgian Benetatos
Georgian Benetatos

Reputation: 728

Android clear ram memory resets apps

I have an android application that uses android volley for some php files. I see that other apps on the market restore themselves when I hit clear ram memory. My application loses the volley httpclient and I lose my session for php. What happens to the app when "Clear memory" is called and whan can I do to refresh my app the right way?

I see that the app closes, but when I reopen it from "recent apps panel" it opens on the last activity, but my first activity does the login and creates the session.

I found about session coockies here : Using cookies with Android volley library But I'm wondering what does "clear ram" does.

Upvotes: 0

Views: 503

Answers (1)

ashoke
ashoke

Reputation: 6461

Create a base activity from which all your activities inherit. In the base activity's onResume , check for valid session (including valid cookies) , if not valid, reopen the login activity, which will recreate new session/cookie credentials, and update session object.

login and session management needs to apart from your base or regular activity.

Upvotes: 1

Related Questions