Daily application
<p>I'm trying to make an application that allows the user to access some information only once a day else to show the user how longer does he have to wait until it can see again that information. <br>
Here is my code:</p>

<pre><code>    long aux_time = prefs.getLong("AUX",System.currentTimeMillis());
    Log.v(TAG, "aux=" + aux_time);
    Log.v(TAG, "time" + System.currentTimeMillis());

if(System.currentTimeMillis() &gt; aux_time + (10000 * 60 * 60 * 24))
    {   

        finish();
        Intent intent = new Intent(Castle.this, Hug.class);
        startActivity(intent);
    }        
   if (System.currentTimeMillis() &gt;= aux_time + (10000 * 60 * 60 * 24))     
    {  
        SharedPreferences.Editor editor = prefs.edit();  
        editor.putLong("AUX", System.currentTimeMillis());
        editor.commit();

        finish();
        Intent intent = new Intent(Castle.this, Hug_Accepted.class);
        startActivity(intent);
    }
</code></pre>

<p>I tested the code. And, I believe, it does open after 24h, but it doesn't opens when I first open the Activity because there is a difference of 0.00000000001 ms between those two when I compare them in the second if. Any ideas?</p>
