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

PictureInPicture sample app keeps crashing. #80

Open
awesome1128 opened this issue Aug 6, 2021 · 3 comments
Open

PictureInPicture sample app keeps crashing. #80

awesome1128 opened this issue Aug 6, 2021 · 3 comments

Comments

@awesome1128
Copy link

Hi Yaraki.
Nice to meet you. You're doing a great jobs.
I saw your repositories, so it's amazing.
I have one issue now. When I try to run your PIP sample app on android emulator, app keeps crashing.
Could you please guide me?
I am waiting for your positive response.
Thank you.

@Y-E-P
Copy link

Y-E-P commented Sep 15, 2021

Hi @awesome1128 Just write check for nullable, because getWindowInsetsController method used for platform 30(or, as I correctly understand, for other versions which supported insets) for make immersive full screen.

private void adjustFullScreen(Configuration config) {
        final WindowInsetsControllerCompat insetsController =
                ViewCompat.getWindowInsetsController(getWindow().getDecorView());
        if(insetsController == null) return;
      ...
    }

Update:
You can use WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()); and it already prepared to handle insets on all Android API.

@sanbrother
Copy link

Hi @awesome1128 Just write check for nullable, because getWindowInsetsController method used for platform 30(or, as I correctly understand, for other versions which supported insets) for make immersive full screen.

private void adjustFullScreen(Configuration config) {
        final WindowInsetsControllerCompat insetsController =
                ViewCompat.getWindowInsetsController(getWindow().getDecorView());
        if(insetsController == null) return;
      ...
    }

Update: You can use WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()); and it already prepared to handle insets on all Android API.

Great!
A PR would be better. 💯

@73alex
Copy link

73alex commented Jul 29, 2022

Ok

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

4 participants