简体   繁体   中英

How to load Activity without animation (like tabs in TabHost load activities) on Android?

I've set up a TabHost containing a TabWiget with three tabs in it - each of which loads a separate activity. This all works well, switching between them is smooth, state drawables on tabs work well and so on.

However, in each activity (ie tab contents) I need to load further activities while still showing the tab bar at the top. Problem is, doing this:

startActivity(new Intent(this, SomeActivity.class);

loads the activity, but with a sliding animation. This looks weird when I'm supposed to have a fixed tab bar at the top (ie it slides out and back in). Switching activities with the tabs does not trigger this animation.

How can I load an activity without the sliding animation? I have no problem doing it through the TabHost if that's required, but its API didn't suggest this was possible.

使用ActivityGroup作为标签内容,然后使用getLocalActivityManager管理其内容似乎是诀窍: http : //blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM