H
H
h1_0ne2020-05-03 01:27:51
Android
h1_0ne, 2020-05-03 01:27:51

How to call fragment constructor when using findNavController().navigate()?

In the application, the transition between fragments is implemented by the following structure:

findNavController().navigate(R.id.fragment_layout_id)

It works properly if the fragment class does not have a constructor. And if it is, then how to call it when switching to a fragment?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2020-05-03
@iLLuzor

You don't need to use a constructor.
Pass the desired arguments through the navigate method, even better with navigation sageargs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question