Getter and Setter return null in Android
<p>so I've been working on a project that receives data from server, for example sessionKey. I created getter and setter method like this :</p>

<pre><code>public class sEngine
{
private static String sessionKey;

public static String getSessionKey() {
        return sessionKey;
    }

    public static void setSessionKey(
            String sessionKey) {
        sEngine.sessionKey = sessionKey;
    }
}
</code></pre>

<p>Then I have activity A. In this activity A, I insert a value into the setter method.</p>

<pre><code>public class A extends Activity
{
@Override
    protected void onCreate(Bundle savedInstanceState) {

sEngine.setSessionKey("Hello world")
}
}
</code></pre>

<p>I also have activity B. In this activity B, I call the getter method</p>

<pre><code>public class B extends Activity
{
    @Override
        protected void onCreate(Bundle savedInstanceState) {

            String sessionKey = sEngine.getSessionKey();
    }
}
</code></pre>

<p>It occurs to me, that Android sometimes wipes all the data in order to free some memory, for example when I let the program idle for too long, or I used Advanced Task Killer. The problem is if those happen,  I will get null in activity B when I call the getter method although I've set the value in activity A. Is there any way for me to maintain the value stored via the setter method (other than using SharedPreference) so the value will still be there although Android wipes the memories/data?</p>
