BlueMango BlueMango - 7 months ago 107
Android Question

Snackbar with API 21

I'm trying to implement the new Snackbars in my app but I can't. First of all I downloaded the zip file from this SnackBarSampleActivity.

I unziped it and then I import it in Eclipse. Now I get an error

retrieving parent...
for the theme parent in

I change it to
and the error was gone. I right clicked the project and checked isLibrary in Properties/Android, I right clicked my app and in Properties/Android I add the library. Finally I paste the code to show a
but I get an error because
Snackbar cannot be resolved

Please somebody help me! I'm going crazy, what am I doing wrong?


You should try to use Android Studio, because the ADT plugin for Eclipse is no longer in active development.

In Android Studio, you just need to add a line compile 'com.nispok:snackbar:2.6.1' in your build.gradle dependencies, such that

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ''
    compile 'com.nispok:snackbar:2.6.1'

That's it.