savedInstanceState is always null, yet onSaveInstanceState() is always called

前端 未结 3 2076
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 02:53

First of all I\'m new to Android - this question could seem stupid :)

I\'ve created an main Activity that contains a ViewPager. The ViewPager is linked to

3条回答
  •  星月不相逢
    2021-01-04 03:34

    The onRestoreInstanceState() method is only called when there is a Bundle object to restore from, i.e. it is NOT NULL. Otherwise, the restore method will not be called.

提交回复
热议问题