Search...

Sunday, November 13, 2011

How to use postDelayed() method in an application


If you wanted to give some pause on your operation and then execute some logic then postDelayed is the correct api for you.
Every view has the postDelayed api.

e.g:-

myView.postDelayed(new Runnable() {
public void run() {
myLayout.setVisibility(View.GONE);

}
}, 3000);

In this case, run method will be executed after 3 sec of delay.

No comments:

Post a Comment