I have a question about Snackbar visibility. I set invisible the Snackbar on xml and I want to make it visible in an if condition but i don't know how to do it because I'm new at coding. If you can help me with this I'd be very happy.
Try It,
snackbar.addCallback(new Snackbar.Callback() {
@Override
public void onDismissed(Snackbar snackbar, int event) {
//see Snackbar.Callback docs for event details
}
@Override
public void onShown(Snackbar snackbar) {
}
});
Please try this code.
snackbar.addCallback(new Snackbar.Callback() {
@Override
public void onDismissed(Snackbar snackbar, int event) {
//see Snackbar.Callback docs for event details
...
}
@Override
public void onShown(Snackbar snackbar) {
...
}
});
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.