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

Fix no view found for id when using API 24. #165

Open
wants to merge 2 commits into
base: fondazione
Choose a base branch
from

Commits on Oct 5, 2021

  1. Fix no view found for id when using API 24.

    On API 24 devices `FragmentStateManager` crashes with exception:
    ```
    Fatal Exception: java.lang.IllegalArgumentException
    No view found for id 0xb8610aaa (unknown) for fragment SomeFragment
    ```
    
    Steps to reproduce:
    1. Run the app
    2. Try to close it and open fast and frequently
    
    Solution:
    Use `ViewCompat.generateViewId()` which is designed to generate view
    id.
    
    My comment:
    Weird thing that this crash is not occurring on latest Android
    versions (e.g. API 30), probably API 24 has some specific view id
    requirements.
    Oleksandr Katrych committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    9ddfd9f View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from OKatrych/bug/api24-missing-id

    Fix no view found for id when using API 24.
    OKatrych committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    08af077 View commit details
    Browse the repository at this point in the history