I am beginner in Android. In my application i want to check if 24 hours passed or not.
I tried code from this article:How to count that 24 Hours passed or not , but when i changed Data and Time settings in my phone, toast still doesn't work. Thanks for help
// Save current time
long savedMillis = System.currentTimeMillis();
// Check time elapsed
if (System.currentTimeMillis() >= savedMillis + 24 * 60 * 60 * 1000) {
Toast.makeText(this,"ABC",Toast.LENGTH_SHORT).show();
}