Wednesday, August 8, 2012

Thread in android | Thread demo in android | How to create a Thread in Android | Handler Class In Android


Hello Dear Friends,
    Some to we got when we create a Thread in android because activity class is also a thread class for facing this problem we should use Handler class. A little example of handler class are given below-

// create thread
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
// call method
add();
}
//sleep thread for 15 mili second
}, 1500);

No comments:

Post a Comment