thiagokimo / KonamiCode

Installs the Konami code easter-egg into your Android app ;)
Apache License 2.0
90 stars 8 forks source link

Cannot resolve symbol 'Callback' #6

Closed feelix93 closed 5 years ago

feelix93 commented 5 years ago

Hi my friend,

I really love your work, but I have a problem.

As you suggested I wanted to customize the final callback by myself.

But when I add:

.callback(new KonamiCode.Callback() {
            @Override
            public void onFinish() {
                //whatever
            }
        })

It says "Cannot resolve symbol 'Callback'".

Can you help me? What do I have to do?

Thanks a lot!!

Kind regards, Felix

(Example what code looks like:)

protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        new KonamiCode.Installer(this)
                .on(this)
                .callback(new KonamiCode.Callback() {

                    public void onFinish() {

                        Toast toast = Toast.makeText(getApplicationContext(), "NERD!", Toast.LENGTH_SHORT);
                        toast.show();

                    }
                })
                .install();

    }
thiagokimo commented 5 years ago

@feelix93 Hi Felix! Thanks for asking.

The callback is defined inside the class KonamiCodeLayout. I noticed my README is wrong. You should use new KonamiCodeLayout.Callback instead.

Will close the issue and fix the README.

feelix93 commented 5 years ago

@feelix93 Hi Felix! Thanks for asking.

The callback is defined inside the class KonamiCodeLayout. I noticed my README is wrong. You should use new KonamiCodeLayout.Callback instead.

Will close the issue and fix the README.

Ahh of course, stupid me.. it figures. Thanks for the quick reply!