So currently I am making a Pokédex for my internship. I've got it working for the biggest part but there's a couple of things I need to get fixed including the question asked above. I have a function called Eeveelutions which has to run three other functions called showVaporeon, showJolteon & showFlareon. They have to run for like 3 seconds each and then just loop around until the person using the pokedex goes to the next or previous pokémon. The thing I need help with is how would I set a timer, (if that's the best way to do it) to run those functions. So, showVaporeon for 3 seconds, then showJolteon for 3 seconds, then Flareon for 3 seconds and repeat. I have searched loads of questions to find my solution but I can't find it yet and most of it is not in kotlin.
So, is there anyone who has got an easy example for me or a better solution (and example) then using a timer.
Searched forum for solutions, messed around with timers, messed around with threads but no solutions yet
fun showVaporeon(){
evoChart2.visibility = View.VISIBLE
Glide.with(this).load(imageBaseURL + "134" + ".png").into(evoChart2)
evolveOption2.text = "Vaporeon"
evolveOption2.text = ""
evoChart2.visibility = View.GONE
}
fun showJolteon(){
evoChart2.visibility = View.VISIBLE
Glide.with(this).load(imageBaseURL + "135" + ".png").into(evoChart2)
evolveOption2.text = "Jolteon"
evolveOption2.text = ""
evoChart2.visibility = View.GONE
}
fun showFlareon(){
evoChart2.visibility = View.VISIBLE
Glide.with(this).load(imageBaseURL + "136" + ".png").into(evoChart2)
evolveOption2.text = "Flareon"
evolveOption2.text = ""
evoChart2.visibility = View.GONE
}
So I would want evoChart2 (which is one of the three imageviews I have) to show Vaporeon for 3 seconds, then Jolteon for 3 seconds, then Flareon for 3 seconds, and then Vaporeon again for 3 seconds, Jolteon, Flareon etc.