timer = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
/*
* Create an Intent that will start the Main WordPress Activity.
*/
Intent mainIntent = new Intent(Splash.this, Login_new.class);
Splash.this.startActivity(mainIntent);
Splash.this.finish();
}
};
Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
/*
* Create an Intent that will start the Main WordPress Activity.
*/
Intent mainIntent = new Intent(Splash.this, Login_new.class);
Splash.this.startActivity(mainIntent);
Splash.this.finish();
}
};
timer.postDelayed(runnable, 15000);
Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
}
};
这样就创建了一个Runable ,runable 就是他的方法名
这就可以操纵这个runable了 比如这样
timer = new Handler();
timer.postDelayed(runnable, 15000);