Finish activity after toast message disappears?

前端 未结 12 1089

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've just make a simple library for that "issue" Download:

    https://github.com/mkiisoft/Toaster

    and use it this way:

    Toaster.getInstance().makeText(context, "your custom message", Toast.LENGTH_SHORT, new OnToasterFinish() {
                    @Override
                    public void finish() {
                        // Your code over here after the Toast
                    }
                });
    

提交回复
热议问题