Ian Lake from google replied me that we can store the view in a variable and instead of inflating a new layout, just return the instance of pre-stored view on onCreateView()
Source: https://twitter.com/ianhlake/status/1103522856535638016
Leakcanary may show this as leak but its false positive..
More Related Contents:
- How to clear navigation Stack after navigating to another fragment in Android
- IllegalArgumentException: navigation destination xxx is unknown to this NavController
- How to change start destination of a navigation graph programmatically?
- Is it possible to set startDestination conditionally using Android Navigation Architecture Component(Android Jetpack)?
- How I can retrieve current fragment in NavHostFragment?
- Proguard causing runtime exception with Android Navigation Component
- ViewPager and fragments — what’s the right way to store fragment’s state?
- How to resume existing Fragment from BackStack
- getView returning null when fragment has been created from an activity
- Show DialogFragment with animation growing from a point
- Fragment in ViewPager using FragmentPagerAdapter is blank the second time it is viewed
- Wrong requestCode in onActivityResult
- One Activity and all other Fragments [closed]
- Android ViewPager get the current View
- Fragment-Fragment communication in Android
- How to use Dialog Fragment? (showDialog deprecated) Android
- How to use Fragments in Android
- What is the benefit of using Fragments in Android, rather than Views?
- Android Navigation Architecture Component – Get current visible fragment
- IllegalStateException: Can’t change container ID of Fragment
- using enableAutoManage() in fragment
- Fragment must be a public static class to be properly recreated from instance state
- android:configChanges=”orientation” does not work with fragments
- Google Maps Fragment returning null inside a fragment
- Why use Fragments? [duplicate]
- Trying to remove fragment from view gives me NullPointerException on mNextAnim
- How to pass result from second fragment to first fragment
- OnCreateView called multiple times / Working with ActionBar and Fragments
- Integrating youtube to fragment
- Android Two Fragments in Same Activity