After closing the main fragment which StepperLayout is located, when I open that fragment again, Step views are not shown and next/prev buttons are not working
Adapter :
class StepperAdapter(fragmentManager: FragmentManager, context: Context) :
AbstractFragmentStepAdapter(fragmentManager, context) {
override fun getCount(): Int {
return 3
}
override fun createStep(position: Int): Step {
return when (position) {
0 -> DeviceNameStepFragment()
1 -> CheckModemStepFragment()
2 -> CheckPermissionStepFragment()
else -> CheckPermissionStepFragment()
}
}
}
MainFragment:
class NewDeviceFragment : Fragment(), StepperLayout.StepperListener {
private lateinit var binding: FragmentNewDeviceBinding
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentNewDeviceBinding.inflate(inflater)
binding.stepperLayout.adapter = StepperAdapter(requireFragmentManager(), requireContext())
binding.stepperLayout.setListener(this)
return binding.root
}
override fun onCompleted(completeButton: View?) {
findNavController().popBackStack()
}
override fun onError(verificationError: VerificationError?) {
}
override fun onStepSelected(newStepPosition: Int) {
}
override fun onReturn() {
findNavController().popBackStack()
}
}
After closing the main fragment which
StepperLayout
is located, when I open that fragment again, Step views are not shown and next/prev buttons are not workingAdapter :
MainFragment: