简体   繁体   中英

dismiss/cancel AlertDialog in parent activity

In my Activity an Alertdialog is raised. When the user clicks the button (there is only one) a new Activity is started. When the user clicks "Back" in the new Activity the parent Activity is raised showing the AlertDialog fram where the child was started. So I'm in an endless loop. How can I automatically cancel/dismiss the Alertdialog in the parent Activity when the user clicks "back" in the child Activity?

Again no one wants to answer, so I had to find a solution my self. It seems it is not trivial to close an existing dialog in the parent activity when returning to it. So the best is to close the dialog before the child activity is started.

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