services_menu_item_rv.apply {
layoutManager = LinearLayoutManager(mContext)
recyclerAdapter = ServicesMenuItemRecyclerViewAdapter(
data,
mContext,
)
adapter = recyclerAdapter
}
I am having bottom nav with 5 tabs. We use custom back stack for each tabs using Stack data Structure. When services fragment was showing perfectly for the first time. But second time when loading it does not show up the recycler view. Adapter is getting set but oncreateViewHolder and onbindViewHolder not calling.
CodePudding user response:
At first , I came up with solution of creating new fragment instance every time tab is switched. That worked.But that is not suited for our custom backstack implementation. But the real problem is because of using kotlin synthetics to bind views. It was a weird issue that occured to me. So tried changing the view accessing to view binding. It working fine as expected.
So its time to fully migrate whole project to view binding.
Hoping to help someone if they face this issue.