Is it possible to programmatically enumerate all of the android.view.Window
s, or decor views within an application?
Dialogs
for example will both open in a new Window
, separate from the main Activity window. I can locate them via Dialog.getWindow()
but I'm not sure how I would do this with a built-in components such as the activity menu popup.
Is there any way, from an Application
, Context
, or the WindowManager
, or something else, to enumerate the Windows associated with my app?
I can see all of my application's windows with adb dumpsys window
, but I'm looking for a way to do this within my application without requiring root.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…