private Handler mHandler = new Handler(); private Runnable mUpdateTimeTask = new Runnable() { public void run() { // do what you need to do here after the delay } };insert this anywhere you want to run
mHandler.postDelayed(mUpdateTimeTask, 2000);
private Handler mHandler = new Handler(); private Runnable mUpdateTimeTask = new Runnable() { public void run() { // do what you need to do here after the delay } };insert this anywhere you want to run
mHandler.postDelayed(mUpdateTimeTask, 2000);
Thread background = new Thread() { public void run() { try { // Thread will sleep for 3 seconds sleep(6 * 1000); // After 3 seconds redirect to another intent Intent mainmenu = new Intent(getBaseContext(), MainActivity.class); // Use fade in fade out transition animation in startActivity ActivityOptions options = ActivityOptions.makeCustomAnimation(intro.this, R.anim.fade_in, R.anim.fade_out); startActivity(mainmenu,options.toBundle()); //Remove activity finish(); } catch (Exception e) { } } }; // start thread background.start();