Skip to content

Public ‘initView’ method to prevent NullPointerException when Surface… #19

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HaoWang0101
Copy link

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.

@HaoWang0101 HaoWang0101 force-pushed the Hwang's_lockscreen_crash_fix branch 2 times, most recently from b562844 to 2bbe5d7 Compare May 22, 2025 18:36
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

Successfully merging this pull request may close these issues.

1 participant