How to pause / sleep thread or process in Android?

后端 未结 12 993
故里飘歌
故里飘歌 2020-11-22 05:49

I want to make a pause between two lines of code, Let me explain a bit:

-> the user clicks a button (a card in fact) and I show it by changing the background of thi

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 06:40

    In addition to Mr. Yankowsky's answers, you could also use postDelayed(). This is available on any View (e.g., your card) and takes a Runnable and a delay period. It executes the Runnable after that delay.

提交回复
热议问题