Days passing application Android
<p>Can someone tell me a simple method to track if a day has passed since the opening of an Activity? Also, do something if has passed and something if not. Thank you! <br></p>

<p>This is my code. I get this class exceptions as if I want to save an int into a long and don't know where.</p>

<pre><code>    Calendar calendar = Calendar.getInstance();       
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

    long aux_time = prefs.getLong("AUX", -1);
    int aux_day= prefs.getInt("DAY", -1);

    if(System.currentTimeMillis()!=aux_time&amp;&amp;calendar.get(Calendar.DAY_OF_WEEK)!=aux_day)
    {  
        ... // Open "Not allowed Activity"
    }

    else            
    {

    SharedPreferences.Editor editor = prefs.edit();
    editor.putLong("AUX", System.currentTimeMillis());
    editor.putInt("DAY", calendar.get(Calendar.DAY_OF_WEEK));
    editor.commit();
    ... //  Open Activity            

}
</code></pre>

<p>Any opinions? <br>
 EDIT: Ahh, about that Int class exception, forgot to clean the editor. Also, the code still doesn't work well.</p>
