Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying logo for few seconds at application start

Tags:

android

I want to display a logo for few seconds before application starts and menu is visible. I want also to use some when it disappears. Should I create a new activity? Can I set it in layout ?

like image 915
Raluca Lucaci Avatar asked Jun 27 '11 15:06

Raluca Lucaci


2 Answers

define a layout for the splash screen which will contain your logo , and then , add this code to your activity :

public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);
    //display the logo during 5 seconds,
    new CountDownTimer(5000,1000){
        @Override
        public void onTick(long millisUntilFinished){} 

        @Override
        public void onFinish(){
               //set the new Content of your activity
               YourActivity.this.setContentView(R.layout.main);
        }
   }.start();
}
like image 170
Houcine Avatar answered Oct 20 '22 00:10

Houcine


You can use an image view that gets setVisibility(Visibility.GONE); or something to that extent, or you can write an activity that just pops up and drops out after a time ends. That is your personal preference...

like image 34
Mutmatt Avatar answered Oct 20 '22 01:10

Mutmatt