1

I have developed an application (somewhat a maths quiz) In which user chooses answers in 4-5 options and there are around 10 questions. While answering the questions if device recieves an incoming call ,the activity gets cleared up and all the answers ticked by the user are cleared. I am updating the table each time user answer a question.This activity is a complex one .

How can I save the state of the application and restart from the same point?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Navdroid
  • 1,541
  • 3
  • 25
  • 52

2 Answers2

2

http://developer.android.com/training/basics/activity-lifecycle/pausing.html#Pause

You can save instance state on pause and restore it on resume

Gjordis
  • 2,540
  • 1
  • 22
  • 32
1

You need to use saveInstanceState and restoreInstanceState, to hold your data refer to this answer, to see how to use this.

Community
  • 1
  • 1
Nickolaus
  • 4,785
  • 4
  • 38
  • 60
  • what means a lot of data to store, you can also implement a custom class for your data you want to store,... that is the Android lifecycle there is no way to bypass it. – Nickolaus Feb 15 '13 at 13:46