public static final long TIMEOUT = 60000;
public static final long SYSTEM_TIME = System.currentTimeMillis();
I have the TIMEOUT Value for my application set as 60000 and i have my system time. Now how would i know that 50 seconds
has been elapsed and i need to show a message to the end-user.
if (TIMEOUT - SYSTEM_TIME <= 10000) {
Toast.makeText(getApplicationContext(), "10 Seconds Left", Toast.LENGTH_LONG).show();
disconnectHandler.postDelayed(disconnectCallback, DISCONNECT_TIMEOUT);
}