You can’t change arguments once its set and Fragment
is added to Activity
, I used a similar approach you defined yourself.
First, I checked the Bundle
passed to onCreate()
, if its not null I use it, but if its null then I use arguments. And I save whatever is the newest data in onSaveInstanceState()
.
For more details: Is it possible to pass arguments to a fragment after it’s been added to an activity?