Public ‘initView’ method to prevent NullPointerException when Surface… #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change addresses the issue of Surface release under specific scenarios, ensuring stable functionality for BlurBehindLayout.
The surface of BlurBehindLayout may get released during screen lock or when the app is sent to the background, causing BlurBehindLayout to turn into a black screen when the activity regains focus. Attempting to update BlurBehindLayout results in IllegalStateException or NullPointerException due to the Surface being already released or locked, leading to app crashes.
The commit makes ‘’initView‘’ method public. This adjustment provides a solution to refresh surface by calling 'BlurBehindLayout.initView(context)'. allowing recreating surface when activity regains focus to preventing crashes.