开发者

View Animations inside Tab

开发者 https://www.devze.com 2023-04-04 20:15 出处:网络
I have following problem: I have a TabActivity which works well. Inside, there is one Activity ( a ListView ) where the user is able to press on an ListItem to see details. So I\'m switching the Views

I have following problem: I have a TabActivity which works well. Inside, there is one Activity ( a ListView ) where the user is able to press on an ListItem to see details. So I'm switching the Views inside my Tab like this:

    public voi开发者_高级运维d replaceContentView(String id, Intent newIntent){
    ActivityGroup ag = null;

    try {
        ag = (ActivityGroup)getParent();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    if (ag != null){
        newIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

        View view = ag.getLocalActivityManager()
                .startActivity(id, newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
                .getDecorView();

        setContentView(view);
    } else {
        startActivity(newIntent);
    }

}

new Activity just "appears" unlikely - very ugly -. How can I animate that currentActivity is fadingOut, while new Activity fades in? I already tried this, but now currentActivity is just fading-out, while listener is never called.


I have done it now through Androids Fragment API which I think it is a good advise to anyone who is playing with LocalActivityManager and DecorView yet

0

精彩评论

暂无评论...
验证码 换一张
取 消