Back to project page you2peer.
The source code is released under:
Apache License
If you think the Android project you2peer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.u2p.events; //from ww w . java 2 s .c o m import java.util.ArrayList; import java.util.EventObject; import java.util.Iterator; import java.util.List; public class ActivityEventsGenerator { private List _listener=new ArrayList(); private EventObject event; public synchronized void addEvent(EventObject event){ this.event=event; _fireEvent(); } public synchronized void addListener(ActivityEventsListener al){ _listener.add(al); } public synchronized void removeListener(ActivityEventsListener al){ _listener.remove(al); } private void _fireEvent() { // TODO Auto-generated method stub Iterator listeners=_listener.iterator(); while(listeners.hasNext()){ ((ActivityEventsListener)listeners.next()).handleActivityEventsListener(event); } } }