# super.onSaveInstanceState does not exist

**URL:** <https://discourse.processing.org/t/super-onsaveinstancestate-does-not-exist/3251>\
**Category:** Processing for Android\
**Created:** [September 4, 2018, 2:29pm UTC](https://discourse.processing.org/t/super-onsaveinstancestate-does-not-exist/3251 "2018-09-04T14:29:51Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [September 6, 2018, 11:29am UTC](https://discourse.processing.org/t/super-onsaveinstancestate-does-not-exist/3251/13 "2018-09-06T11:29:39Z")

</div>

@KTibow===  
finally i got an idea (in some sense it is a bad idea but…): i suppose that you want to have the same values for your int (pages) even when there is a change in the orientation of the phone. Is it true? - In this case you have 2 solutions: first one is to use set retaininstance(true) on the fragment in which is the sketch; but in order to do that you have to “find” this fragment; normally you can do that using FragmentManager and findViewById or find by tag: looking to the mainActivity from P5 i see that the fragment has a tag (“main-fragment”) and i have tried to get it this way: no chance, i dont know exacltly why (perhaps because the fragment is not a Fragment but a “PFragment”, perhaps because this tag is “private”. So there is only one solution: that is using the Manifest and adding to it the config changes tag which means that you are taking care of config changes yourself in the code. I have tried this solution and it works: my values are not destroyed when the orientation changes, hurrah! - Remains one problem= what happens if the user hits the back button??? - In this case my values are destroyed and that is the case to use sharedPreferences…

---

_[View the full topic](https://discourse.processing.org/t/super-onsaveinstancestate-does-not-exist/3251)._
