I extended an Application and I need data to NOT persists after application is closed
<p>It is simple I guess.</p>

<p>I have a User and some other objects that I need to use along many activities of my application, so I decided to create a class and extend Application to make these objects "globals", e.g. after the user does the login, I have the user object along all my activities to use.</p>

<p>The problem is that after the application is closed the data is not lost/reseted. So when I open my app again, it does not ask for me to do my login again. So I need to somehow close the other Application. How do I do it?</p>

<p>A palliative solution I found is to set the variables to <code>null</code> when <code>backPressed</code> is called from <code>MainActivity</code> (and my application is closed), but I know it is not right, must have a more elegant way to do it.</p>
