I'm new to android. In my app i have an arrayList which is being filled by objects being downloaded from internet. Concurrently i need two activities to have access to the arraylist, whether it is completed or not. I know things about services but i don't have any idea about how to code this. any help? My code seems like below:
class A extends Service {
void foo(){
//uses a loop to get elements from internet
//then adds the elements to myArraylist in each loop
}
}
class B extends Activity {
//needs to have access to myArraylist asynchronously
}
class C extends Activity {
//needs to have access to myArraylist asynchronously
}
By the way, as of any activities, these two activities won't call for myArrayList simultaneously. And i'm not sure about using services. Any other offer?