How to retain EditText data on orientation change?

后端 未结 12 1951
暗喜
暗喜 2020-12-05 13:34

I have a Login screen which consists of 2 EditTexts for Username and Password. My requirement is that on orientation change , input data(if any) in EditText should r

12条回答
  •  盖世英雄少女心
    2020-12-05 13:54

    in onConfigurationChanged method, first get the data of both the edit texts in global variables and then call setContentView method. Now set the saved data again into the edit texts.

提交回复
热议问题