显示机器人弹出的后台服务 [英] show pop-up from background service in android
问题描述
喜有可能在Android的显示从后台运行的服务弹出的对话框? 而答案是比我怎么能做到这一点正面
Hi it is possible in android to show pop-up dialog from background running service? and answer is positive than how can i do that
推荐答案
有几种选择。您可以使用一个主题,使活动的外观和行为像一个对话框(如在的这个问题)通过设置机器人:你的
到&LT主题
属性;活动> @android:款式/ Theme.Dialog
或你的清单中包含自定义主题
There are several options. You can use a theme and make an activity look and behave like a dialog (as in this question) by setting the android:theme
attribute of your <activity>
to @android:style/Theme.Dialog
or a customized theme in your manifest.
另外,您也可以通过主题设置为 @android创建一个半透明的活动:款式/ Theme.Translucent.NoTitleBar
,然后从该活动启动定期对话。随着对问题的答案告知一个意见,在这种情况下,只要确保完成()
时被驳回的对话框半透明的活动。
Alternatively, you could create a translucent activity by setting the theme to @android:style/Theme.Translucent.NoTitleBar
and then launch a regular dialog from the activity. As the comments on one of the answers to the question advise, in this case just make sure to finish()
the translucent activity whenever the dialog is dismissed.
这篇关于显示机器人弹出的后台服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!