Skip to content

Commit

Permalink
Add a description Avoid Memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves authored Dec 29, 2019
1 parent 04c392b commit 824a988
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ override fun onBindViewHolder(holder: MySpinnerViewHolder, position: Int) {
}
```

### Avoid Memory leak
Dialog, PopupWindow and etc.. have memory leak issue if not dismissed before activity or fragment are destroyed.<br>
But Lifecycles are now integrated with the Support Library since Architecture Components 1.0 Stable released.<br>
So we can solve the memory leak issue so easily.<br>

Just use `setLifecycleOwner` method. Then `dismiss` method will be called automatically before activity or fragment would be destroyed.
```java
.setLifecycleOwner(lifecycleOwner)
```

## PowerSpinnerView Attributes
Attributes | Type | Default | Description
--- | --- | --- | ---
Expand Down

0 comments on commit 824a988

Please sign in to comment.