How to put some delay in calling an activity from another activity?

You can use something like this:

 new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {

                          Intent i=new Intent(SearxhJobs.this,JobsTypes.class);
                          startActivity(i);
                      }
                  }, 5000);

Here it waits upto 5 seconds to launch activity.

Hope it helps


You can do it with a Handler like this

    Handler h = new Handler(){
        @Override
        public void handleMessage(Message msg) {

            Intent i = new Intent().setClass(ctx, MainActivity.class);                  
            startActivity(i);
        }           
    };

    h.sendEmptyMessageDelayed(0, 1500); // 1500 is time in miliseconds