In Activity1 have 1 button ,if user clicks on button it goes to Activity2.here i want to change button flow based on result in activity10,i.e if result is OK in Activity10 then Activity1 renders then user clicks on button it should show activity5(After reopened the app also app should show this result).I tried by using Bundle but when i reopened the app first scenario executing,it can be achieved by using shared-preference by taking a Boolean variable but dont know how,suggest me with piece of code to handle this multiple activities with shared preference?help me
Asked
Active
Viewed 36 times
0
-
yes you can achive this using OnActivityResult calling for more chk this http://stackoverflow.com/questions/7262405/handling-onactivityresult-in-android-app-having-more-than-one-activity – Parag Chauhan Dec 07 '13 at 12:20
-
Once i reopened the app then again starting same flow with onActivityResult ??means Activity1-->Activity5 – Dec 07 '13 at 12:22
-
yes for that Alex answer is good for you. – Parag Chauhan Dec 07 '13 at 12:27
1 Answers
0
From any place you can do
int prefVal = PreferenceManager.getDefaultSharedPreferences().getInt("myint", defVal);
and
PreferenceManager.getDefaultSharedPreferences().edit().put("myint", 100).commit();
Based on the last stored value you, probably, can figure out what to display.

Alexander Kulyakhtin
- 47,782
- 38
- 107
- 158