Finish activity after toast message disappears?

前端 未结 12 1124

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:16

    android.widget.Toast doesn't offer any listeners for informing when it is finished.

    You may call Toast.getDuration() to learn how long it will last, and make your own TimerTask to run at the time when Toast vanishes, and do your tasks there.

提交回复
热议问题