Solution 1 :
It will wait 5 seconds before processing the code inside the Runnable. Usually this will be used to repeat a task at regular intervals.
Problem :
If I delay handler
for 5 seconds,
- will
handler
process all the code inside it during this time? - Or it will just wait for 5 seconds to process inside code?
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//code
}
}, 5000);