Questions tagged [savestate]

A bundle of state variables. Often used to sore and retrieve the application state upon a device rotation.

A bundle of state variables. Often used to sore and retrieve the application state upon a device rotation.

363 questions
115
votes
7 answers

How to use onSavedInstanceState example please

I'm confused when it comes down to saving a state. So I know that onSaveInstanceState(Bundle) is called when the activity is about to be destroyed. But how do you store your information in it and bring it back to its original state in…
tj walker
  • 1,333
  • 3
  • 15
  • 18
18
votes
4 answers

Saving scroll state of NestedScrollView

My application revolves around a HomeActivity which contains 4 tabs at the bottom. Each of these tabs is a fragment, all of them are added (not replaced) from the start, and they are hidden/shown upon tapping the appropriate tab. My problem is that…
Julian Honma
  • 1,674
  • 14
  • 22
17
votes
2 answers

What is the best way to save game state?

I find the best way to save game data in Unity3D Game engine. At first, I serialize objects using BinaryFormatter. But I heard this way has some issues and is not suitable for save. So, What is the best or recommended way for saving game state? In…
Sizzling
  • 215
  • 1
  • 3
  • 7
15
votes
1 answer

Android: Save an instance state when app is closed

Possible Duplicate: How do I save an Android application's state? I am new to Java and Android and building some small projects to learn. I made a money tracking app which allows the user to input values and it simply continues to subtract it.…
user1218728
  • 159
  • 1
  • 4
14
votes
6 answers

Save/Restore fragments state android

I am trying to create an app that uses Jack Wharton's ViewPager library (here) using only images for every page (something like Prixing (here) main screen). Everything works ok, except for the saveInstance in the Fragment. In Jack Wharton's…
DoruAdryan
  • 1,314
  • 3
  • 20
  • 35
12
votes
7 answers

Android Fragment Back Stack

I have used multiple Fragments in my Project. I want to save a Fragment's state and restore this state when I come back to this. In this Fragment I show multiple images which change on button click. I use the following code for this: String…
12
votes
2 answers

save the state when back button is pressed

I am developing an android app. If I press a back button the state of my application should be saved .What should i use to save the state ..am confused with all of these onPause(),onResume(), or onRestoresavedInstance() ??? which of these should i…
Sindu
  • 215
  • 3
  • 6
  • 16
10
votes
1 answer

Saving the state of a WebView and reloading the position

I know there are multiple questions about this but they all seem to be old and not working anymore - at least for me. I am trying to save the position of a webview after a user quits or reloads the app. I know that this code could be used to save…
user1363871
  • 580
  • 3
  • 11
  • 29
9
votes
2 answers

Remember what folders were collapsed / opened

I have a big iOS-project with many folders / groups. When I quit and restart Xcode, all folders in the Project Navigator are shown expanded, so I have to collapse most of them manually. Is it possible to save the state of the Project Navigator, so…
A.G.
  • 2,037
  • 4
  • 29
  • 40
9
votes
2 answers

Does WebView saveState() preserve Javascript variables/environment?

I've searched many threads and still cannot find the answer to my question. I'm working on an Android app which uses WebView. I use onSaveInstanceState() and onRestoreInstanceState() to save the WebView state like this: @Override public void…
user2113581
  • 277
  • 1
  • 4
  • 11
7
votes
1 answer

Saving Primefaces layout state

I understand that Primefaces Layout and Dashboard have state which can be saved. Could someone help me with snippet code (or some tutorial / how to ) site on how to save Primefaces layout (fullpage) into some persistent database or file. In this…
Aditya
  • 757
  • 8
  • 11
7
votes
1 answer

What is a good example of saving game data in XNA 4.0?

I am trying to work my way through the XNA MSDN documentation on saving and reading game data, and I am not having much luck. In essence I have a manager class which keeps track multiple instance of base classes. I want to be able to save the state…
NA Slacker
  • 843
  • 6
  • 12
  • 24
7
votes
2 answers

Fragment is recreate on back press from other Fragment

I am facing a problem in regarding fragment. In my scenario, There are two fragment associated with FragmentActivity. In FragmentActivity, there are a container layout (Frame Layout) in which all fragment will replace. public void…
7
votes
0 answers

Save & restore Fragment's UI state when pushed and popped out of the backstack

Background: I have a main Activity, it wraps a main Fragment that can be changed, and in order to keep a backstack I use FragmentManager's backstack. The main difference from keeping an activity stack is that when a fragment is pushed to the…
ndori
  • 1,934
  • 1
  • 18
  • 23
7
votes
1 answer

How to save an activity's state?

As stated in the question, I want to know how to save an activity's state. My application has a list of products and allows the user to click on a product, starting the second activity that displays all the information about that product. On that…
1
2 3
24 25