Advertisement
sandi_s

SplashScreenActivity.java

Feb 17th, 2018
1,468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. package lokadin.sandy.example.com.lokadin;
  2. import android.content.Intent;
  3. import android.os.Bundle;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.view.View;
  6. import android.widget.LinearLayout;
  7. /**
  8.  * Created by sandy on 7/9/2017.
  9.  */
  10. public class SplashScreenActivity extends AppCompatActivity {
  11.     LinearLayout linlaHeaderProgress;
  12.     @Override
  13.     protected void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.activity_splash_screen);
  16.        linlaHeaderProgress  = (LinearLayout) findViewById(R.id.linlaHeaderProgress);
  17.         linlaHeaderProgress.setVisibility(View.VISIBLE);
  18.         Thread timerThread = new Thread(){
  19.             public void run(){
  20.                 try{
  21.                     sleep(3000);
  22.                 }catch(InterruptedException e){
  23.                     e.printStackTrace();
  24.                 }finally{
  25.                     Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
  26.                     startActivity(intent);
  27.                 }
  28.             }
  29.         };
  30.         timerThread.start();
  31.     }
  32.     @Override
  33.     protected void onPause() {
  34.         // TODO Auto-generated method stub
  35.         super.onPause();
  36.         finish();
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement