I\'m adding dynamically created EditTexts to a layout (onClick button method). When I rotate the screen the added edittexts disappear. How can I add them to a bundle to put them
You cannot add views to a bundle because they are not parcelable / serializable. The only stuff you can and should save into the bundle is the current state of the activity.
You could maintain a list data structure or a counter variable that keeps track of the dynamically created views. Also save the string values of the EditTexts. In onCreate you should interpret that information in order to recreate the views and their states.
you can't save a view. bundle is just a pair name-value. of course you can save the text and then render it again. the way is just you said.
onsaveInsatnceState(bundle save) save the text as save.putString('text1','bla bla') of course you need a loop to save all your edittext.
then in oncreated( bundle save)
you can get what you have added by save.getString('text1')
Views itselfs doesn't represents information that you need to save. Instead you should save their coordinates, width, height, value etc.
Your can save your view data into a class or into a arraylist. when your fragment activity will restart than you fetch data from saveinstance state in oncreate function.
Use this function setRetainInstance(true). after using thing function your fragment activity will not destroy.