Window 经理动画师状态和 activity 返回堆栈
Window manager animator state and activity back stack
我想知道这两者是否相关。
我无法在另一个 activity 之上显示对话框。
我想我做的是:
- 开始activity拨打phone电话,
BroadcastReceiver
监听 Intent.ACTION_NEW_OUTGOING_CALL
启动 activity(带有 Intent.FLAG_ACTIVITY_NEW_TASK
标志),它将显示对话框(我们称之为 InCallActivity
),
- 在
InCallActivity
的onCreate
我建一个DialogFragment
然后显示出来
我看到的只是com.android.dialer/com.android.incallui.InCallActivity
,没有我的对话。
dumpsys window animator
说
Window #0: WindowStateAnimator{42433660 com.android.systemui.ImageWallpaper}
Window #1: WindowStateAnimator{428f9a20 com.google.android.googlequicksearchbox/com.google.android.launcher.GEL}
Window #2: WindowStateAnimator{4287ae60 com.android.settings/com.android.settings.DevelopmentSettings}
Window #3: WindowStateAnimator{42800678 com.android.settings/com.sprd.settings.SprdUsbSettings}
Window #4: WindowStateAnimator{428939d8 myApp/myApp.MainActivity}
Window #5: WindowStateAnimator{42835be0 myApp/myApp.InCallActivity} <- that's probably the activity itself
Window #6: WindowStateAnimator{4283f518 myApp/myApp.InCallActivity} <- that's probably the dialog
Window #7: WindowStateAnimator{4282de98 com.android.dialer/com.android.incallui.InCallActivity}
Window #8: WindowStateAnimator{426e5cb0 InputMethod}
Window #9: WindowStateAnimator{424e09b8 KeyguardScrim}
Window #10: WindowStateAnimator{424dd0a8 Keyguard}
Window #11: WindowStateAnimator{422c4598 StatusBar}
并且android.task.incallui
总是在任务堆栈的顶部
Running activities (most recent first):
TaskRecord{427a9cf8 #745 A=android.task.incallui U=0 sz=1}
Run #4: ActivityRecord{423c18e8 u0 com.android.dialer/com.android.incallui.InCallActivity t745}
TaskRecord{427d0768 #744 A=myApp U=0 sz=1}
Run #3: ActivityRecord{42373f28 u0 myApp/.InCallActivity t744}
TaskRecord{424b8170 #743 A=myApp U=0 sz=2}
Run #2: ActivityRecord{422f0fb0 u0 myApp/.MainActivity t743}
TaskRecord{4289c550 #657 A=com.sprd.settings.SprdUsbSettings U=0 sz=1}
Run #1: ActivityRecord{41ac4b30 u0 com.android.settings/com.sprd.settings.SprdUsbSettings t657}
TaskRecord{42778c78 #522 A=com.android.settings U=0 sz=1}
Run #0: ActivityRecord{41a8a0b0 u0 com.android.settings/.DevelopmentSettings t522}
mResumedActivity: ActivityRecord{423c18e8 u0 com.android.dialer/com.android.incallui.InCallActivity t745}
mLastPausedActivity: ActivityRecord{42373f28 u0 myApp/.InCallActivity t744}
如何在 com.android.dialer/com.android.incallui.InCallActivity
之上显示该对话框?
好吧,我找到了解决方法。
我没有将 activity 显示为对话框(或 activity 中的对话框),而是 运行 显示带有布局参数的小部件(添加新视图)的服务,例如 TYPE_SYSTEM_ALERT .
我想知道这两者是否相关。
我无法在另一个 activity 之上显示对话框。 我想我做的是:
- 开始activity拨打phone电话,
BroadcastReceiver
监听Intent.ACTION_NEW_OUTGOING_CALL
启动 activity(带有Intent.FLAG_ACTIVITY_NEW_TASK
标志),它将显示对话框(我们称之为InCallActivity
),- 在
InCallActivity
的onCreate
我建一个DialogFragment
然后显示出来
我看到的只是com.android.dialer/com.android.incallui.InCallActivity
,没有我的对话。
dumpsys window animator
说
Window #0: WindowStateAnimator{42433660 com.android.systemui.ImageWallpaper}
Window #1: WindowStateAnimator{428f9a20 com.google.android.googlequicksearchbox/com.google.android.launcher.GEL}
Window #2: WindowStateAnimator{4287ae60 com.android.settings/com.android.settings.DevelopmentSettings}
Window #3: WindowStateAnimator{42800678 com.android.settings/com.sprd.settings.SprdUsbSettings}
Window #4: WindowStateAnimator{428939d8 myApp/myApp.MainActivity}
Window #5: WindowStateAnimator{42835be0 myApp/myApp.InCallActivity} <- that's probably the activity itself
Window #6: WindowStateAnimator{4283f518 myApp/myApp.InCallActivity} <- that's probably the dialog
Window #7: WindowStateAnimator{4282de98 com.android.dialer/com.android.incallui.InCallActivity}
Window #8: WindowStateAnimator{426e5cb0 InputMethod}
Window #9: WindowStateAnimator{424e09b8 KeyguardScrim}
Window #10: WindowStateAnimator{424dd0a8 Keyguard}
Window #11: WindowStateAnimator{422c4598 StatusBar}
并且android.task.incallui
总是在任务堆栈的顶部
Running activities (most recent first):
TaskRecord{427a9cf8 #745 A=android.task.incallui U=0 sz=1}
Run #4: ActivityRecord{423c18e8 u0 com.android.dialer/com.android.incallui.InCallActivity t745}
TaskRecord{427d0768 #744 A=myApp U=0 sz=1}
Run #3: ActivityRecord{42373f28 u0 myApp/.InCallActivity t744}
TaskRecord{424b8170 #743 A=myApp U=0 sz=2}
Run #2: ActivityRecord{422f0fb0 u0 myApp/.MainActivity t743}
TaskRecord{4289c550 #657 A=com.sprd.settings.SprdUsbSettings U=0 sz=1}
Run #1: ActivityRecord{41ac4b30 u0 com.android.settings/com.sprd.settings.SprdUsbSettings t657}
TaskRecord{42778c78 #522 A=com.android.settings U=0 sz=1}
Run #0: ActivityRecord{41a8a0b0 u0 com.android.settings/.DevelopmentSettings t522}
mResumedActivity: ActivityRecord{423c18e8 u0 com.android.dialer/com.android.incallui.InCallActivity t745}
mLastPausedActivity: ActivityRecord{42373f28 u0 myApp/.InCallActivity t744}
如何在 com.android.dialer/com.android.incallui.InCallActivity
之上显示该对话框?
好吧,我找到了解决方法。 我没有将 activity 显示为对话框(或 activity 中的对话框),而是 运行 显示带有布局参数的小部件(添加新视图)的服务,例如 TYPE_SYSTEM_ALERT .