Running any code after some interval.

Running any code after some time .


int SPLASH_TIME_OUT=2;

  new Handler().postDelayed(new Runnable() {


/*   * Showing splash screen with a timer. This will be useful when you   * want to show case your app logo / company*/

      @Override      public void run() {
          // This method will be executed once the timer is over
          Intent i = new Intent(WelcomeScreen.this, WelcomeActivity.class);// Login          startActivity(i);
          finish();
      }
  }, SPLASH_TIME_OUT);

Comments