4

This question has been answered already by Ian Lake, from Google. I was suggested to recreate the question on StackOverflow and answer it myself, so it might help someone else who googles it :)

When using Navigation API, and SafeArgs:

val args: SomeFragmentArgs by navArgs()

Does the args field keep its values after the activity gets killed by the system and recreated? In other words: does the Bundle sent to the Fragment survive?

Tiago Nunes
  • 351
  • 1
  • 8

1 Answers1

8

The answer given to me by Ian Lake (from Google):

The Bundle of arguments sent to a Fragment are indeed part of the Fragment's saved instance state. There's no reason to store it again separately

So indeed, it does survive.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Tiago Nunes
  • 351
  • 1
  • 8