Starting a View from a Service?

后端 未结 6 1472
攒了一身酷
攒了一身酷 2020-12-10 17:52

Already asked a similar question, yet without much luck.

Suppose I have a service and I need a view to pop up above it. In the same time, they both should be intract

6条回答
  •  粉色の甜心
    2020-12-10 17:54

    I guess you are misusing the word "Service". Service is invisible, Activities are visible.

    There are no buttons in an Service!

    So you have no choice! You should put both views in one Activity, and I would use a RelativeLayout and set the visibility of your chidren to GONE/Visible.

    http://developer.android.com/reference/android/widget/RelativeLayout.html

    Also using a popup and making the layout under it clickable will disturb the user. You are completely changing User experience. I strongly suggest too make your popup appear at the top/bottom of your initial layout

提交回复
热议问题