It seems the window stack does not represent what I see on the screen.
Consider this scenario.
A activity start up, and it create a dialog, let us call this dialog
A.
The window type of dialog A is changed to TYPE_SYSTEM_ALERT.
Dialog A create another Dialog, let us call this dialog B.
using adb shell dumpsys window, the window stack log shown that Dialog
B is sitting on top of Dialog A. But only Dialog A is visible. I
would expect Dialog B to appear on top of Dialog A .
sorry it should be TYPE_SYSTEM_ALERT instead of TYPE_SYSTEM_DIALOG
On Sep 3, 11:07 am, eli <sweehoe.l...@gmail.com> wrote:
> The screen is showing what I expected, no doubt about it. But the
> window stack is not. I would expect the screen is showing what the
> window stack is listing.
> ex.
> adb shell dumpsys window log
>
> Window #4:
> - Dialog B
> mBaseLayer:=11000 (TYPE_APPLICATION)
> Window #3:
> - Dialog A
> mBaseLayer=81000 (TYPE_SYSTEM_DIALOG)
>
> On Sep 3, 3:05 am, Dianne Hackborn <hack...@android.com> wrote:
>
> > It is doing exactly what you asked, by making the dialog TYPE_SYSTEM_ALERT
> > which puts it on top of all normal windows. If you don't want that, don't
> > do it. (And I am pretty positive that dialog A -is- in the window list on
> > top of dialog B, especially since as you say it is indeed showing up on
> > top.)
>
> > On Wed, Sep 2, 2009 at 12:47 AM, eli <sweehoe.l...@gmail.com> wrote:
>
> > > It seems the window stack does not represent what I see on the screen.
> > > Consider this scenario.
> > > A activity start up, and it create a dialog, let us call this dialog
> > > A.
> > > The window type of dialog A is changed to TYPE_SYSTEM_ALERT.
> > > Dialog A create another Dialog, let us call this dialog B.
>
> > > using adb shell dumpsys window, the window stack log shown that Dialog
> > > B is sitting on top of Dialog A. But only Dialog A is visible. I
> > > would expect Dialog B to appear on top of Dialog A .
>
> > --
> > Dianne Hackborn
> > Android framework engineer
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails. All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
TYPE_SYSTEM_ALERT has permission
android.Manifest.permission.SYSTEM_ALERT_WINDOW with protection level
set to "dangerous" . So any application can use it.
But my concern is since window stack is not in sync with screen, I
cannot depend on window stack to determine the "on-screen" window
stack. Is there any other method you can suggest?