How to make data independent of activity

by rajaramyadhav » Sat, 17 Jul 2010 02:25:35 GMT


Sponsored Links
 Hi All,

I am new to  Android development. My requirement is something like
this. I have two list activities and a service. I also have to
maintain some data in an two different arraylist which are used by the
activity to display. The data will be populated by the service. Since
adding the new elements to arraylist has to be done by the service,
the data has to be independent of the activity. So I had to put it in
an external class. Now whenever an element is added the activity
should be notified. How can I do this in a clean way? I somehow made
it to work using a static handler for activity and a static adapter .
But I dont think this is a good way to do this.  Can someone suggest
me a better way?

Any sample code snippets would help too..

Thanks in advance for your help.
Raja Ram

--



Other Threads

1. Is it possible to apply a frame animation to a Custom Button or Toast View





I have no idea, but "is it possible" questions are usually easily answered
on your own by "try and see".

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 

2. pasar malem kenapa ya?

mau tanya nih. pasar malemnya kok nggak bisa di buka kenapa ya? atau
alamatnya pindah? setahu saya kan www.bl**kma**et.com kan?

-- 
"Indonesian Android Community [id-android]" 

3. Try to build a XGA App in Emulator

4. sdcard MEDIA_MOUNTED, File.canRead = true, File.canWrite = false

5. Facebook Quickly Releases Fix for Battery Drain Issues in App Update

6. NullPointerException with OnTouch

7. Android Market Abusive developers...