java wait function code example
Example 1: how to wait a few seconds in android studio
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
// yourMethod();
}
}, 5000); //5 seconds
Example 2: wait method in java
java.lang.Object.wait() causes current thread to wait until another thread
invokes the notify() method or the notifyAll() method for this object.