I implemented a quick search in my application. But when I turned the screen, the Instant Search box is destroyed.
How save the value entered in the Quick Search box when turning screen?
I need to save the value when user turned the screen. That is, the user has entered something into the search box, do not hit the Search Button and turned the screen. Need to re-run the Search Box and write in EditText Search value which we have retained.
This works In application YouTube .
Please, help me.
Basically, you need to save the contents in onSaveInstanceState() method and restore (if any) in onCreate() of your activity – there’s a Bundle object that gets passed around for this exact purpose.
Check out this: http://developer.android.com/guide/topics/resources/runtime-changes.html and this: http://developer.android.com/reference/android/app/Activity.html for more detailed info on configuration change and Activity lifecycle.