2

As title, when I change permission and go back to the app, the app init the onCreate again, can I prevent it?

User maybe execute some operation before change permission, except store data to sqlite or static parameters, have any good idea to show that data When return to app?

please help me, thank you.

rocoo
  • 61
  • 6

2 Answers2

0

Set a flag settingPermissions = true in your activity when you start change permissions flow.

Check the flag at the start of onCreate method and skip the part you want to avoid running again.

Viral Patel
  • 32,418
  • 18
  • 82
  • 110
  • Your answer can solve init oncreate again question, but has other question, do you have any ideas? – rocoo Aug 02 '16 at 08:46
0

Check this and https://stackoverflow.com/a/32776377/5515371 and https://stackoverflow.com/a/33488642/5515371. You need to use Fragments and Save the State of the Activity

Community
  • 1
  • 1
Mujammil Ahamed
  • 1,454
  • 4
  • 24
  • 50