Created
August 14, 2018 14:17
-
-
Save psinetron/cc87b90099f7775b417a9ddd9553046d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Это объяви в самом верху активити | |
long seconds = 5000; // 5 секунд | |
Handler handler = new Handler(); | |
//Это в onResume | |
handler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
pb.setVisibility(View.VISIBLE); | |
handler.postDelayed(this,seconds) | |
} | |
}, seconds); | |
//Это в onStop | |
handler.removeCallbacksAndMessages(null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment