问题描述
我想显示如图所示的自定义对话框。对话框必须居中对齐。清单和程序需要哪种权限?
解决方法
Android中的顶部通知窗口称为抬头通知,
您的问题已在此处提出(为了使用通知提示):
How to Custom Heads-up notification layout?
,您也可以检查此链接,以便使用在各种Android API中正确弹出的通知:
android show notification with a popup on top of any application
但是您可以通过服务(例如FCM服务)简单地显示对话框:
Show a Dialog when Firebase Notification is received and App is in the background