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
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
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.