Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Switch between activities with viewflipper

In my android app I am using two activities and I want to make a smooth switch between these activities. I have seen many reference tutorials tells that ViewFlipper can make a smooth switch between views in one activity. So I would like to know if I can use ViewFlipper to switch between activities or Is there any other possible way to do this. At present I am just using button clicks that will start an activity but the switch doesn't look good.

I would be grateful for any suggestions.

Thank You,

Baluk

like image 868
Balakrishna Avatar asked Dec 07 '10 21:12

Balakrishna


2 Answers

ViewFlipper can only handle views not Activities. If there is a way to wrap an activity in a view then you might be able to emulate it but I fear the navigation stack would get confusing.

like image 175
Andrew White Avatar answered Oct 18 '22 18:10

Andrew White


What you actually want to do is to set a custom or just another type of animation for when the Activity is being called or ended.

The answer is yes. You can do that using the overridePendingTransition() method right after calling one of the startActivity() flavors or on the finish() method.

like image 35
Octavian A. Damiean Avatar answered Oct 18 '22 20:10

Octavian A. Damiean