private fun init(uuid: UUID) {
binding!!.crimeViewPager.adapter = object : FragmentStateAdapter(supportFragmentManager, this.lifecycle){
override fun getItemCount(): Int = list.size
override fun createFragment(position: Int): Fragment {
Log.i("createdOlolo", "createFragment: $position")
val crime: Crime = list[position]
return CriminalFragment.newInstance(crime.mid)
}
}
for (i in list.indices) {
if (list[i].mid == uuid)
binding!!.crimeViewPager.currentItem = i
}
Hello all, createdOlolo in Logcat doesn’t show, it looks as createFragment method didn’t run
Problem is empty window in the Criminal fragment