I want to execute a piece of code So that users can pay attention to my LOGO Like other APP
I want to use timer Execution setContentView. Compiler is not wrong. But execution error. unfortunately has stopped.
Timer timer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
abc();
}
public void abc() {
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
goToLayout1();
}
private void goToLayout1() {
setContentView(R.layout.activity_main2);
timer.cancel();
}
}, 1000, 2000);
}
}