uylmz
uylmz

Reputation: 1562

Android pop up dialog from service

What is the way to create a popup screen that's opened from a background service while app is not running in foreground?

Refer to the Skype answer-reject dialog when there's an incoming call:

enter image description here

I have a background service that always runs even the app is not visible to user, but how can I pop up a screen like in the image from that service?

Update:

I am looking for the term used for this kind of screens, is it a regular activity started from the service, or some form of "notification" ?

Upvotes: 0

Views: 3032

Answers (1)

AlphaQ
AlphaQ

Reputation: 676

This popup shows exactly that.

You can start an Activity with:

android:theme="@android:style/Theme.Dialog"

Do Read: If I can remember properly, I have read somehwere that it is against the Android guidline of using popup from a service. It recommends using a Notification service.

Upvotes: 1

Related Questions