I have built an RSS Feed widget but my problem is how do I temporarily store the rss feed data cause when I put the phone on sleep and then try to iterate through the widget, the static public variable loses all the data. It’s very similar to the facebook widget with two arrows.
What is the best method of storing data of an android widget?
It loses the data in its member variables because the object (I presume the WidgetProvider) is indeed thrown away by Android. In fact you will never see the same instance again!
So, as already pointed out: save your data in SharedPrefs (for “small things”) or even a database if it is more.
In your case I guess what you need is a ContentProvider for your data (which in turn will most probably have a database or flat file backend)