📜  android如何知道snackbar何时完成 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:02.700000             🧑  作者: Mango

代码示例1
snackbar.addCallback(new Snackbar.Callback() {

    @Override
    public void onDismissed(Snackbar snackbar, int event) {
        if (event == Snackbar.Callback.DISMISS_EVENT_TIMEOUT) {
            // Snackbar closed on its own
        }
    }

    @Override
    public void onShown(Snackbar snackbar) {
        ...
    }
});