Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pop up dialog in Android home screen

Tags:

android

dialog

Is it possible to show pop up dialog (AlertDialog) in home screen on the android device via services?

like image 459
standalone Avatar asked Sep 29 '11 02:09

standalone


People also ask

What is a dialog window in Android?

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.

What is alert dialog in Android?

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.

What is a dialog popup?

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.


1 Answers

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

like image 87
Arnab Chakraborty Avatar answered Sep 27 '22 21:09

Arnab Chakraborty