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, pl开发者_开发问答ease suggest me. Thank you in advance
Thanks and Regards, Devindrappa
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.
I think that tutorial could help you:
http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/
Ivan
精彩评论