Android developer, there is an ImageView control in ScrollView. I want the user to hide what I should do three seconds after seeing it.

android developer. There is an ImageView control in ScrollView. I want the user to hide what I should do three seconds after seeing it. I don"t know how to judge that the user has seen it. Ask for advice

Feb.27,2021

1. Use Handle and thread's sleep (long) method
2, adopt Handler's postDelayed (Runnable, long) method

  • handler.postDelayed (runnable, 2000); / / execute runnable. every two seconds

3. Adopt the method of combining Handler with timer and TimerTask

  • define timers, timer tasks, and Handler handles
  • initialize timer task
  • start and close timers

4. Use AlarmManger to achieve long-term and accurate timing tasks

finally, iv.setVisibility (View.INVISIBLE) or gone at the right time

Menu