package com.github.stephanenicolas.loglifecycle;

import android.app.Activity;

import java.util.ArrayList;

@SuppressWarnings("UnusedDeclaration")
public class ActivityListenerUtil {

    private static final ArrayList<ActivityListener> listeners = new ArrayList<>();
    
    public static void registerListener( ActivityListener listener ) {
        listeners.add(listener);
    }

    
    public static final class internal {

        public static void _onStart( Activity activity ) {
            for( ActivityListener listener : listeners )
                listener.onActivityStarted(activity);
        }
        public static void _onResume( Activity activity ) {
            for( ActivityListener listener : listeners )
                listener.onActivityResumed(activity);
        }
        public static void _onPause( Activity activity ) {
            for( ActivityListener listener : listeners )
                listener.onActivityPaused(activity);
        }
        public static void _onStop( Activity activity ) {
            for( ActivityListener listener : listeners )
                listener.onActivityStopped(activity);
        }
        public static void _onDestroy( Activity activity ) {
            for( ActivityListener listener : listeners )
                listener.onActivityDestroyed(activity);
        }

    }
}



@@ -266,105 +266,738 @@
 ();%0A
+%0A
     
-%0A    public static void registerListener( ActivityListener listener ) %7B%0A        listeners.add
+/**%0A     * Use this method to register a listener to listen to all activities.%0A     * It's important that this listener does not have any references to any%0A     * contexts, or those contexts will never be garbage collected.  So pay%0A     * particular attention when creating anonynmous inner classes inside of%0A     * activities, services, views, etc., since those will all have implicit%0A     * references to the context.%0A     * %0A     * See #unregisterListener if you wish to explicitly de-register a listener.%0A     */%0A    public static void registerListener( ActivityListener listener ) %7B%0A        listeners.add(listener);%0A    %7D%0A%0A    public static void unregisterListener( ActivityListener listener ) %7B%0A        listeners.remove
 (lis

add unregister and comments