Andrey Novikov
Andrey Novikov

Reputation: 5593

Snackbar.setCallback() can not be resolved in Android AppCompat

I have successfully added snackbar to my application, but when I try to add a callback compiler fails to resolve setCallback() method. Is it a bug in AppCompat or I'm missing something?

Upvotes: 3

Views: 1017

Answers (2)

Andrey Novikov
Andrey Novikov

Reputation: 5593

This was fixed in v23 of Android Design Support Library.

Upvotes: 4

Rafal Zawadzki
Rafal Zawadzki

Reputation: 901

I just stumbled at the same problem and it really looks like Snackbar docs mention a callback that does not exist.

There are ways to implement most common tasks, though. More info in these threads:

How can I be notified when a Snackbar has dismissed itself?

Snackbar in Support Library doesn't include OnDismissListener()?

Ugly hacks, but for us devs it's bread and butter ;)

Upvotes: 1

Related Questions