title: Save instance of dynamically generated views when we switch back and forth between activities
body: <p>I am inflating a view on button click and the user can add as many views as he likes, all is fine I made it work, but now the problem is when I go back one activity and come again to my dynamically generated activity every single view that was generated is gone. Similar is the case if I go to next activity and come back to the inflated activity. I know about <code>onSaveInstance</code> and <code>onRestoreSaveInstance</code>. But how do I put view information in a bundle in <code>onSaveInstanceState</code>? Please note that my view was generated Dynamically i.e. on button Click and I want to know as of how to preserve the state of my activity.
  How do you go about it?</p>