Is it possible to show pop up dialog (AlertDialog) in home screen on the android device via services?
A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed. Dialog Design.
Alert Dialog shows the Alert message and gives the answer in the form of yes or no. Alert Dialog displays the message to warn you and then according to your response the next step is processed. Android Alert Dialog is built with the use of three fields: Title, Message area, Action Button.
A pop-up dialog is sometimes used to present the user with some important information, to request a confirmation, or even to serve a built-in form that captures their contact information. It might be triggered by a button, or it could be set to appear once the user scrolls to a certain location on the page.
You could create an Activity
with the Theme.Dialog
theme. In your AndroidManifest.xml
file add the theme to the activity, like this:
<activity android:name=".DialogActivity" android:theme="@android:style/Theme.Dialog"></activity>
From your service simply start this Activity
. You will have to start the activity with the Intent.FLAG_ACTIVITY_NEW_TASK
flag. See How to start an Activity from a Service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With