Saturday, December 24, 2016

Android Tutorial Create Simple Splash Screen Using Thread

Hi! Today i going to share about Splash Screen. Yeah how to display splash screen using Thread. It not to difficult if you understand about Thread.

What is actually Thread means?

A thread is an execution context, which is all the information a CPU needs to execute a stream of instructions.

Suppose you're reading a book, and you want to take a break right now, but you want to be able to come back and resume reading from the exact point where you stopped. One way to achieve that is by jotting down the page number, line number, and word number. So your execution context for reading a book is these 3 numbers.

More, you can read HERE

Back to the main topic, to create a splash screen by follow this tutorial, so the things that you have to do is like the following preparation :

  1. Image, if you don't have an image, you find find much on Google Image
  2. activity_main.xml
See also :  How to change language on apps without open menu setting. You can read more HERE

Modify your activity_main.xml, and paste the following code :

change android:background="@drawable/paper" with your image. And don't forget set the progressbar GONE.

Modify your, please take a look of some code below :

A normal splash page is need a full screen. It means the action bar or something like that must be hidden. The following code will make the screen is full



Before enter to the thread, in your onCreate set the progressBar is VISIBLE. And after two second, the progressbar will GONE and the activity will move to the next activity. Take a look at the following code :

Handler handler = new Handler();
handler.postDelayed(new Runnable(){
    @Override    public void run(){
        Intent intent  = new Intent(SplashScreenActivity.this, BeforeMainActivity.class);

That'ss all about how to create splash screen using Thread. Hope it helps. Thank you

Related Posts