1 package foo; 2 3 import static androidx.lifecycle.Lifecycle.Event.ON_STOP; 4 5 import androidx.lifecycle.Lifecycle.Event; 6 import androidx.lifecycle.LifecycleObserver; 7 import androidx.lifecycle.LifecycleOwner; 8 import androidx.lifecycle.OnLifecycleEvent; 9 10 class InheritanceOk2Base implements LifecycleObserver { 11 @OnLifecycleEvent(ON_STOP) 12 public void onStop(LifecycleOwner provider) { 13 } 14 } 15 16 class InheritanceOk2Derived extends InheritanceOk2Base { 17 @OnLifecycleEvent(ON_STOP) 18 public void onStop2(LifecycleOwner provider) { 19 } 20 } 21