如果在其他活动的顶部保持对话/活动,无论用户是否在活动之间切换,都应该一直活着。
How to keep a dialog/activity on the top of other activities, no matter if user switch between activities,it should be alive all the time.
推荐答案
您可以使用相对布局作为父项,通过使用相对布局,可以与其他布局重叠。所以,你必须使用相对布局的两个子布局。在一个孩子中,您将有弹出窗口,而在另一个布局中,您必须不断更改布局。
You can use Relative layout as a parent, by using Relative Layout, you can overlap the other layout. So, you have to use to two child layout of relative layout. In the one child you will have popup, and in another layout you have to keep changing your layout..
如果您希望跨多个活动。您必须创建一个单独的布局,并将其包含在所有活动中,并创建一个界面来处理弹出窗口中的按钮事件。
If you want this across multiple activities. You must create a separate layout and include that in all activities, and create an interface to handle the button events in the popup.
或
您可以创建一个基础活动,具有上述布局,并将该活动扩展到您想要此布局的所有其他活动。
You can create a base activity, having above mentioned layout, and extends that activity in all other activities where you want this layout.
Yuvi
Regards, Yuvi
更多推荐
保持对话/活动始终在顶部
发布评论