kotterknife
kotterknife copied to clipboard
bindView does not work perfectly with fragment withing viewpager
I've viewpager with 5 fragments one of the fragment has recyclerView private val recyclerView : RecyclerView by bindView(R.id.list)
It works find once it first appears but one I move to other fragment and return to the fragment that has list, the list does not appear and I get
recyclerview No adapter attached; skipping layout
I switch to regular view.findViewById(). the issue has been resolve.
it looks bindView does not bind to fragment's view or something
I think you can try this forked version https://github.com/rubengees/kotterknife and call KotterKnife.reset(this)
in onDestroyView() of fragments in viewpager.
override fun onDestroyView() {
super.onDestroyView()
KotterKnife.reset(this)
}