SavedInstanceState is always null in fragment

All the problem was in that I don’t declare android:id for the fragment in XML. Android needs ID or TAG to recognize stored fragment and reproduce all elements in it. So guys, remember – every instance of fragment needs unique id or tag!

Also, when setRetainInstance(true) is declared then bundle should always return null.

Leave a Comment