简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM