I want to make a hider count down so that in application when a user clicks on a Button that button should not appear again before 3 days or 2 days ...
I am new to Android Please Help
Google For AlarmManager. https://developer.android.com/training/scheduling/alarms.html . How to set an alarm to be hit after 48Hours or more.
Save current time in preference at the alarm setting time.
Receive Device Boot Up Events. Android BroadcastReceiver on startup - keep running when Activity is in Background . As if device gets switched off. You will loose your set alarm
On device boot up fetch the time from your preference when you had set the alarm.
Calculate the time left for alarm to hit and set alarm again.
48Hours - (CurrentTime - YourLastAlarmCreationTime)
Do whatever at the time alarm manager notifies your receiver that time is over.
This should be simple. Let me know if there is anything you want more to know. And don't think of any timer or thread of your app to do this for you.