switching between two activity in Android

My requirement is I will start Video player activity after some delay Video player activity should hide and GPS activity should show after some delay GPS activity should hide and video player activity should show and this should continue. How can I achieve this requirement, please suggest me. Thank you in advance

Thanks and Regards, Devindrappa

Upvotes: 0

Views: 274

Answers (2)

Vineet Shukla
Vineet Shukla

Reputation: 24021

When your activity starts put Handler like this in your oncreate method:

Handler handler = new Handler();
handler.postDelayed(new Runnable(){
   public void run() {
      startActivity(new Intent(getApplicationContext(), Activity.class));
   }
}, specify your time here);

The above handler will start your activity after the time period which you will specify.Do the same in your both activity.

Upvotes: 1

Ivan
Ivan

Reputation: 4234

I think that tutorial could help you:

http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/

Ivan

Upvotes: 0

Related Questions