android fragment onRestoreInstanceState

Shaun picture Shaun · Mar 24, 2011 · Viewed 72.6k times · Source

Am I missing something or do Fragments not have a onRestoreInstanceState() method? If not, how do I go about attaining something similar?

Answer

mgv picture mgv · Mar 24, 2011

Fragments do not have an onRestoreInstanceState method.

You can achieve the same result in onActivityCreated, which receives a bundle with the saved instance state (or null).

Check the source code here.