How to put a View into Bundle

后端 未结 4 2410
梦毁少年i
梦毁少年i 2021-02-20 11:59

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

4条回答
  •  醉酒成梦
    2021-02-20 12:30

    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.

提交回复
热议问题