1

I recently programmed a game on api 14. However i realized that not all my friends are yet upgraded there android phones, so i decided to program it on api 7. However when i changed the properties from eclipse, there was a function (recreate()) that isn't valid in api 7. So my question is, what is the way around it? The thing is, i have a menu button, called Instructions, and when pressed it changes the layout to another view where i have the instructions. But when i press back, i want the previous activity to recreate() as if running for the first time! Any ideas? Thanks!

1 Answers1

2

Option #1: Implement two activities.

Option #2: Implement two fragments and use FragmentTransactions, using the Android Support package's implementation of fragments that works on API Level 4+.

Option #3: Call setContentView() to replace the existing UI with a different one.

Option #4: Call startActivity() for your own activity to create a new instance, then immediately call finish() to destroy the original instance.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491