NullPointerException on a BlurView previously shown
See original GitHub issueI’m having trouble hiding and showing a BlurView, I have a grid with a few tiles, when a button is pressed the blur appears and then the user can hide it. When I show it for the first time or multiple times on the same tile it works properly but when I show it on another tile and go back to the first one I get an exception. The BlurView is inside a RelativeLayout and I’m using alpha + visibility to show/hide the layout (but it also happens if the Blur is outside this layout).
My code is:
final float radius = 8;
final View rootView = itemView.getRootView();
overlay.setupWith(rootView)
.blurAlgorithm(new RenderScriptBlur(itemView.getContext(), true))
.blurRadius(radius);
overlay.stopAutoBlurUpdate();
This is the exception:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getLeft()' on a null object reference
at eightbitlab.com.blurview.DefaultBlurController.setupInternalCanvasMatrix(DefaultBlurController.java:181)
at eightbitlab.com.blurview.DefaultBlurController.drawBlurredContent(DefaultBlurController.java:212)
at eightbitlab.com.blurview.BlurView.draw(BlurView.java:57)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.v7.widget.RecyclerView.drawChild(RecyclerView.java:4134)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3543)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1131)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1377)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
Thanks in advance.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
android Null pointer exception when trying to blur a bitmap
It probably finds backdrop . The problem is here Bitmap b = BitmapFactory.decodeResource(getResources(), R.id.backdrop);.
Read more >Android crash · Issue #405 · Kureev/react-native-blur - GitHub
We see a fair number of these show up in our bug reporting system: java.lang.NullPointerException Objects.java:220java.util.Objects.
Read more >Solved The following line of code throws a | Chegg.com
O four O five. The following line of code throws a NullPointerException: String s = person.friends[. Show transcribed image text ... answer image...
Read more >NullPointerException (Beginning Java forum at Coderanch)
Java.lang.NullPointerException. Guys i was working with multidimensional array and when i try to execute this following program i get this error.
Read more >ImageJ Release Notes - NIH
Thanks to Michael Schmid, fixed a bug that caused "Synchronize Windows" to throw a NullPointerException when using the "Close All" command.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please check 1.1.0 version, I believe it should be fixed now.
It was fixed indeed, thanks!