-1

I add the buttons dynamically to an activity, but They are lost When I click back button or when I move to the parent Activity. How to retain them??

1 Answers1

0

When you press back button the activity is destroyed. SO when you open it again it will be freshly created with default state. If you want to persists the buttons you can save the state to either SharedPreferences or global variables in application class.

Mayur
  • 46
  • 1
  • 7