android - Retaining fragment state along with activity -


i have retained state of activity while switching between activities setting intent flag single top. activity contains fragment.the activity state gets retained fragment gets recreated. how retain activity state along fragment state android using flags?

you can call fragment.setretaininstance(true); method tell fragment should retain it's state when activity recreated:

http://developer.android.com/reference/android/app/fragment.html#setretaininstance(boolean)


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -