In one of my methods, I have toastone that appears if the user enters the correct input. However, I do not want the next image to be displayed until the toast ends.
If I use Thread.sleep(3000), if it doesn’t allow me to toastshow when the user interface activity is sleeping.
An example of what I'm trying to do:
public void correction(){
if(correctionBoolean == true){
Toast.makeText(this, "Correct!", Toast.LENGTH_SHORT).show();
if(Toast.time == finished){
NextImage();}
}
source
share