ohadinho
ohadinho

Reputation: 7144

Android Service and AlertDialog Activity

I'm trying to build a service which runs in the background and pops up an alert dialog even when you are not in the application screen currently. I'm using an alarm manager. My problem is that when my alert dialog activity pops up - it shows the application activity as background. In other words, I don't want the alert dialog to change the current background and after the user is clicking "OK" it will be back to the same state, and not to my application. How can I do that ?

Upvotes: 1

Views: 3410

Answers (1)

Albin
Albin

Reputation: 4220

The easiest way would probably be to let the service pop up a new activity. Either you make the activity itself look like a dialog by adding the proper theme in the AndroidManifest.xml:

<activity android:name=".DialogActivity" android:theme="@android:style/Theme.Dialog">

or you make a completely transparent activity that shows a dialog when it starts.

Upvotes: 3

Related Questions