Sino Raj
Sino Raj

Reputation: 6441

To overlay a custom dialog for parent Activity to all views including child activity in android

I need to show a custom dialog overlays over all child activities. But that dialog's base context is background. Is it possible?. This is used for custom lock to whole application after wake up(Screen On). I have a broad cast receiver to manage that. But that receiver is registered through parent activity. When the screen go to sleep from parent activity that dialog/process executes correctly. But the screen go to sleep from child activity that dialog shows background of child activity, when I will back to the parent activity then that shows. I think this occurred on dialog's context.

Upvotes: 2

Views: 614

Answers (1)

David Manpearl
David Manpearl

Reputation: 12656

You need to use an Activity instead of a Dialog. Set your Activity theme to emulate a Dialog in the manifest.

Example - AndroidManifest.xml:

android:theme="@android:style/Theme.Dialog"

Then, you will have more flexibility and control over its display.

Upvotes: 4

Related Questions