Skip to content

Null Views and NPE when dealing with fragments #72

@avsector

Description

@avsector

The validity of a view reference should be checked before attempting to show the SnackBar. When using SnackBar and suppling the view in the builder for the fragments, there's a slight chance that when the SnackBar is building the view is no longer available, hence causing a NullPointerException.

An easy way to produce this is showing SnackBar in asynchronous callbacks in the fragments. Simply start an asynchronous job and navigate away from the fragment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions