简体   繁体   中英

Display multiple activities on same screen

Is it possible to show two activities on the same screen at the same time? I need each activity to show data that changes with time.

或者也许你可以使用AndroidFragments

It's late after the question. But you should look at ActivityGroup

Inherits from Activity, so you should be able to run this as the parent.

Yes, it is definitely possible. Even when you display a menu or a dialog, that menu/dialog is a separate activity running on top of yours. However, you should avoid doing that as much as possible. It is only useful to display two activities at the same time if one of the activities does not belong to your application (which is the case with menus/dialogs). If both activities come from your own application, you should find a way to merge them into one. This way you use up less memory and less CPU (as there's no overhead of starting a new process).

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