package com.example.splashscreen; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // configuring the window to full screen getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); // calling handler to run a task for a specific time interval new Handler().postDelayed(new Runnable() { @Override public void run() { // creating a new intent Intent i = new Intent(MainActivity.this, MainActivity2.class); // start a new activity startActivity(i); // start current activity finish(); } }, 2000); } }