Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Last active March 12, 2021 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/059ac5610cb4559ca884b5b54c091967 to your computer and use it in GitHub Desktop.
Save PatilShreyas/059ac5610cb4559ca884b5b54c091967 to your computer and use it in GitHub Desktop.
class LeakFragment : Fragment() {
private val mAdapter: MyListAdapter by autoCleaned { MyListAdapter() }
private var binding: ProfileBinding by autoCleaned()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = ProfileBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.recyclerView.adapter = mAdapter
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment