How does Froyo display the dialogue on the main screen?

I updated my Nexus One a few days ago with 2.2 (Froyo). This morning, when I went to use it, I saw that the Dialog is sitting on the home / launcher screen, notifying me that the update is available and that I can choose the update now or later.

My question is, which API mechanisms use this to show a Dialog (possibly AlertDialog) on ​​top of the main screen? Having written an Android application, I realized that Dialogs can only be displayed on Activity and that the service cannot show Dialog (Toast only).

Perhaps Google can hide the action so that it looks like a dialogue? Is there a new API method for showing a dialog that does not require action?

+3
source share
1 answer

You can use a theme similar to a dialog box, it has been there for a while (I think 1.6, maybe even 1.5)

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

This will create what I think you see.

+10
source

Source: https://habr.com/ru/post/1752869/


All Articles