Android: Viewing Two Activities in One Screen

偶尔善良 提交于 2019-12-01 17:48:42

None of what you want is possible with activities. The closest thing is using themes so that your "side activity" is partially visible behind other non-full-screen activities. However, getting this to work properly on a wide range of screen sizes will be difficult, and managing your task stack to pull this off does not strike me as being much fun.

You should be able to create something that resembles what you seek with the proper application of fragments, but you will wind up with one large activity and a bunch of fragments, as opposed to a bunch of activities.

At the activity level, Android is not designed for some persistent element that you seek.

You can achieve something that is similar to what you want (in terms of what the user sees). But it wouldn't be actually two activities running.

Check Fragments Documentation. I think you want to use two fragments: one on the top of the screen and another one on the bottom.

Like others have said, you can't have multiple Activities on screen at once. However, you could refactor your separate activities into Views, then show a single Activity with one persistent View alongside a group of swappable Views (managed by tabs or ViewFlipper).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!