-2

Possible Duplicate:
Android SplashScreen

I am new to android application development.

I developed one android application using android sdk. i install .apk file in samsung tab,and it is working properly.

But my requirement is before my application home page launching i have to display my company logo in one screen and my application title in another screen each 5sec after that my application home page have to display automatically.

please help me go forward.

Community
  • 1
  • 1
user1632949
  • 615
  • 3
  • 9
  • 18
  • Google "splash screen". And you should probably read up on Android (and perhaps java) in general before proceeding. – keyser Oct 19 '12 at 11:04

3 Answers3

2
       startTime = System.currentTimeMillis();


     TimerTask enableTask = new TimerTask() {
     public void run() {
             handler.post(new Runnable() {
                     public void run() {
                      currenttime = System.currentTimeMillis();
             if(currenttime-startTime > 30000) {

             Intent intent = new Intent(Activity.this,
                    nextActivity.class);

            startActivity(intent);
             }
             else {

              go.setVisibility(View.GONE);
             }
                     }
            });
     }};

  Timer t = new Timer();
  t.schedule(enableTask,1000, 30000);
Amit Prajapati
  • 13,525
  • 8
  • 62
  • 84
0

Use a timer. Start Timer which runs for a specific period. Say 5 seconds. When the timer finishes , close your first activity which displays company logo and start the second activity.

Raghunandan
  • 132,755
  • 26
  • 225
  • 256
0

use Thread.sleep() in Asynck Task as:

private class splashAsync extends AsyncTask<Void, Void, Void>
{
        protected void onPreExecute(){

        }     
        protected Void doInBackground(Void... params) {
        try { 
            Thread.sleep(1000);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return null;
        }
        protected void onPostExecute(Void v){
        startActivity(new Intent(Activity1.this,Activity2.class));
        finish();
        }
      }
AppMobiGurmeet
  • 719
  • 3
  • 6