Answers for "splash screen activity in android"

4

splash screen android studio

///*********************declarling time here********************
    private static int SPLASH_TIME_OUT = 4000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //This  code is used for hide the sheek bar of application************************************
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //***********************************************************************************************

        setContentView(R.layout.activity_main);

// this code is for splash screen ************************************************
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(MainActivity.this,HomeActivity.class);
                startActivity(intent);
                finish();
            }
        },SPLASH_TIME_OUT);
    }
Posted by: Guest on June-07-2020
0

Splash Screen Android

public class MainActivity extends AppCompatActivity{
	private static int SPLASH_TIME_OUT = 5000;
	@Override
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		new Handler().postDelayed(new Runnable(){
			@override
			public void run(){
				Intent homeIntent = new Intent(MainActivity.this, HomeActivity.class);
				startActivity (homeIntent);
				finish();
			},SPLASH_TIME_OUT) ;
	}
}
Posted by: Guest on July-01-2021

Code answers related to "splash screen activity in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language