Gautam Jain
Gautam Jain

Reputation: 671

Create Dialog without activity

How can I implement such a dialog, no activity is running.
Is the activity invisible or what?

enter image description here

Upvotes: 0

Views: 310

Answers (2)

hadi julaee
hadi julaee

Reputation: 31

In your dialog you need to set type of Window which dialog attached, as follows:

dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);

Do not forget declaring android.permission.SYSTEM_ALERT_WINDOW permission in your manifest.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007359

How can I implement such a dialog, no activity is running.

You can't.

Is the activity invisible or what?

Possibly, perhaps using Theme.Translucent.NoTitleBar.

More likely, what you think is a Dialog is really a dialog-themed Activity. The main themes (e.g., Theme.Material, Theme.AppCompat) have specific themes with Dialog in their names that cause the activity's window to not fill the entire screen.

Upvotes: 1

Related Questions