How to Switch between activities with viewflipper
Asked Answered
E

2

6

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

Ethelind answered 7/12, 2010 at 21:21 Comment(0)
D
3

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.

Deprivation answered 7/12, 2010 at 21:29 Comment(0)
A
3

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.

Attitudinarian answered 7/12, 2010 at 21:32 Comment(2)
Thanks for the reply. I been through the function overridePendingTransition() and came to know that it only works from 2.0 version not under that. As I want my application can be installed on all versions from 1.6, I guess I am out of luck. Is there any other way around to solve the problem. But it is good to know that there is a function for activities too.Ethelind
@Balakrishna: You're totally right. I forgot about backwards compatibility.Attitudinarian

© 2022 - 2024 — McMap. All rights reserved.