views:

73

answers:

1

Hi All,

In my application, I have two different activities and both are list activities. I use a SimpleAdapter for each activity and each adapter binds to an arraylist during the onCreate. Both arraylists are present in a different class. Now if there is any change in the arraylists, I have to notify the corresponding activity. I currently made it to work using a public static handler for the activity and calling the handler.sendMessage from the class where arraylists are stored. But I am not very happy with this solution. Is there a better way to do it? Am I missing some Android feature that can easily do this stuff?

A: 

You could simply subclass your ListActivity, and define the arraylist on that level, and inherit from your custom ListActivity for those other two classes, and they will use the same arraylist.

Pentium10