How to implement 'pop up box' in Android similar to Viber (when a message is received)

瘦欲@ 提交于 2019-12-06 11:09:09

问题


I work as a junior Android developer and the client has requested the following:

"Make research about implementation of pop up box, while application is in background. Thea idea is always when there is notification to show in notification panel, also to be shown in pop up box." (Viber was taken as an example of this)

I know how to work with activities and fragments and views in Android, but I don't know how to even google about this so I thought someone could point out a tutorial or just say if there is a word for this technique so I can study it. When a new message is received (Broadcast Receivers) the 'pop up box' is shown on top of the Android system. My question would be what is the pattern and what are the key pointss in implementing this feature. Thank you in advance


回答1:


Broadly speaking, possible way is to implement pop-up as an activity with transparent background. Here is the starting point: How do I create a transparent Activity on Android?




回答2:


It is so simple.

You just create Activity extends Dialog type.

So your activity type should show as image in above - the activity dialog.



来源:https://stackoverflow.com/questions/22174411/how-to-implement-pop-up-box-in-android-similar-to-viber-when-a-message-is-rec

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