• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How can I make my app pause for 5 seconds?

Hello again,

Ive been trying many combination of examples (yes - im still learning), but so far ive been unable to make my program pause for 5 seconds.

My goals is this:

Display a picture for 5 seconds, then display buttons.

The only thing that is different from other examples ive seen is that the content is produced dynamically on the screen, no xml is used.

Can anyone please help?

Ive been trying different examples, but none seem to simply pause the program without making the app force close.

The current method im trying is:
Code:
int pause = 15; 
        int startTime = 0;
		while ( System.currentTimeMillis() <= startTime + (pause * 1001)){ 
                       if (System.currentTimeMillis() >= startTime + (pause * 1001)) { 
                       }}

Thanks in advance,
GIR
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones