All those member variables/fields you set while a user interacts with an activity are going to become null when the user rotates their screen. However, the views being managed by your activity will preserve themselves – whether they were visible, what text set in them, and some other properties. To preserve the info that will be lost to the screen rotation, store information by overriding public void onSaveInstanceState(Bundle outState), and restore it by pulling out out of the bundle passed into public void onCreate(Bundle instanceBundle).
Read more