Finish activity after toast message disappears?

前端 未结 12 1146

Does anybody know, if there is a possibility to do something (in my case finish activity) on toast message will be closed?

12条回答
  •  余生分开走
    2020-12-01 11:17

    I'm not sure you can do this with Toasts, however, you could replace the toast by a simple dialog (and reuse the Toast design if you want), and then you could use methods such as onDetachedFromWindow to hook the closure of the activity to the window's.

提交回复
热议问题