Even after the screen goes how to show the data in it.I read we can use shared preferences.But i have too many edittext and spinners in many screens.Also i use async class along with it, so it takes a lot of time to fetch data and come back.So when the screen goes off, the whole activity gets restarted again.The selections i made in spinners and editext goes off.So i think it is better to keep the screen turned on while the app is running since we use async task. How to keep the screen turned when app is running.
this.getWindow().setFlags(this.getWindow().getFlags() & ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
How to avoid this screen restarting and keep the values inside spinners and editext?