Hi there everyone. I'm kinda noob to android so please bear with me. I'm currently developing app which uses tabs. My question now is: how to store values of variables so I can access them on the other tabs? I want to create something similar to sessions in PHP where I can save variables on one page and access on the other. Please can someone help me with this? There has to be an easy way to solve this. Thanks in advance!
A:
One solution would be to use static variables to implement the "Singleton" pattern. This question presents a much better alternative for Android, which involves extending Application class and then accessing it using Context.getApplicationContext().
kgiannakakis
2010-06-09 08:07:56
A:
Thanks kgiannakakis for answering.The thread/article you provided is excellent!
Pavel
2010-06-09 09:11:32
+1
A:
Might be worth having a look at SharedPreferences:
How to use guide http://developer.android.com/guide/topics/data/data-storage.html#pref
Class ref http://developer.android.com/reference/android/content/SharedPreferences.html
disretrospect
2010-06-09 09:12:46