java - Android: Save state of list view using savedInstanceState -
i have standard implementation of listview
(one uses array adapter) , 1 of in-built layouts r.layout.simple_list_item_multiple_choice
.
anyway, reading activity
lifecycle , how when screen orientation changes or if phone call occurs, 1 way restore activity
state using onsaveinstancestate
, onrestoreinstancestate
methods.
my question is, can me how can store state of listview
(not customised) bundle, includes entries, position , checked items
many thanks
you want data persistent. have use sqlite database or sharedpreferences. can use device's internal storage or external storage according needs. here link provide detailed explanation.
onsaveinstancestate
instances when accidentally app's data lost killing process or when phone call comes. cannot store data in onsaveinstancestate
deliberately retrieve according needs.
Comments
Post a Comment