kotterknife icon indicating copy to clipboard operation
kotterknife copied to clipboard

bindView does not work perfectly with fragment withing viewpager

Open MuBoori opened this issue 7 years ago • 1 comments

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

MuBoori avatar Jan 21 '18 09:01 MuBoori

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)
}

faizator avatar Jan 25 '18 23:01 faizator