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

Cannot initialize component dynamically #66

Open
stellio-team opened this issue Jul 15, 2019 · 1 comment
Open

Cannot initialize component dynamically #66

stellio-team opened this issue Jul 15, 2019 · 1 comment

Comments

@stellio-team
Copy link

I get crash when try to create blurView dynamically. Look at the code - this contructor is useless. Just replace super with this and it will work without crash.

public BlurLayout(Context context) { super(context, (AttributeSet)null); this.invalidationLoop = new NamelessClass_1(); }

What crash I get:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageBitmap(android.graphics.Bitmap)' on a null object reference at io.alterac.blurkit.BlurLayout.invalidate(BlurLayout.java:166)

@MartinNovak1991
Copy link

MartinNovak1991 commented Sep 25, 2020

Same problem ...
If BlurLayout is created programatically system throws this error.

Issue fixed if I used this constructor

blured=new BlurLayout(ctx, null);

instead

blured=new BlurLayout(ctx);

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