Can we interact with background activity when displaying a dialog over it in android

后端 未结 4 1602
深忆病人
深忆病人 2021-01-21 08:12

I want to display a dialog over an activity but still want to interact with background activity to perform something, while the dialog is being displayed. How can this be done?

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-21 08:58

    A Dialog is still part of the same Activity. They just use different windows.
    Since you haven't posted any code, I'll answer you theoretically that when building you Dialog, you should keep a reference to the Activity that holds it. This way you would still be able to communicate with it.

提交回复
热议问题