Q:

Apply SplashScreen without making Thread and run()

there is my code .. I wanna make splash screen without Thread timer .. 
How can I do that ? 
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Thread timer = new Thread() {
        public void run() {
            try {
                sleep(2000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } finally {
                // myCode();

                }
            }
        }
    };
    timer.start();
} }

A:

you can use following code , i think is good for you.  
   public class SplashActivity extends AppCompatActivity {
   @Override
   protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
     new Handler().postDelayed(new Runnable(){
        @Override
        public void run() {
            Intent mainIntent = new 
            Intent(SplashActivity.this,AnotherActivity.class);
            startActivity(mainIntent);
            finish();
        }
    },3000);
   }
 }

