Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE: FloatingActionButton.SwitchIconAnimator #24

Open
sviro opened this issue Jan 24, 2019 · 1 comment
Open

NPE: FloatingActionButton.SwitchIconAnimator #24

sviro opened this issue Jan 24, 2019 · 1 comment

Comments

@sviro
Copy link

sviro commented Jan 24, 2019

Hi,
here is a stack trace from a crash we observed in our app using your library:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
at com.bvapp.arcmenulibrary.widget.FloatingActionButton$SwitchIconAnimator.run(FloatingActionButton.java:719)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

@BrotherV
Copy link
Owner

If you check the error you will find out the problem happened because you passed a null Drawable as an icon to FloatActionButton. If you want to add a FloatActionButton and add an icon programmatically, you can pass a Drawable by ResId or by a Drawable. Also I completely deactivated SwitchIconAnimator class in this library whereas you used it manually and this crashed happened because mPrevIcon object was null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants