1 package foo; 2 3 import static android.arch.lifecycle.Lifecycle.Event.ON_START; 4 import static android.arch.lifecycle.Lifecycle.Event.ON_STOP; 5 6 import android.arch.lifecycle.Lifecycle.Event; 7 import android.arch.lifecycle.LifecycleOwner; 8 import android.arch.lifecycle.OnLifecycleEvent; 9 10 public class Bar { 11 @OnLifecycleEvent(ON_START) 12 public void doOnStart() { 13 } 14 15 @OnLifecycleEvent(ON_STOP) 16 public void doOnStop1Arg(LifecycleOwner provider) { 17 } 18 19 @OnLifecycleEvent(ON_STOP) 20 public void doOnStop2Args(LifecycleOwner provider) { 21 } 22 23 public static class Inner1 { 24 @OnLifecycleEvent(ON_START) 25 public void doOnStart() { 26 } 27 28 public static class Inner2 { 29 @OnLifecycleEvent(ON_START) 30 public void doOnStart() { 31 } 32 33 public static class Inner3 { 34 @OnLifecycleEvent(ON_START) 35 public void doOnStart() { 36 } 37 } 38 } 39 } 40 } 41