@Test public void onActivityDestroyed() throws Exception { final Activity mockActivity = mock(Activity.class); final NotificationPressedInterceptorCounter mockCounter = mock(NotificationPressedInterceptorCounter.class); final NotificationActivityLifecycleListener lifecycleListener = new NotificationActivityLifecycleListener(mockCounter); lifecycleListener.onActivityDestroyed(mockActivity); verify(mockCounter).updateCounter(mockActivity, false); }
@Override public void onActivityDestroyed(Activity activity) { this.counter.updateCounter(activity, false); }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityDestroyed(Activity activity) { this.counter.updateCounter(activity, false); } }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityDestroyed(Activity activity) { this.counter.updateCounter(activity, false); } NotificationActivityLifecycleListener(@NonNull final NotificationPressedInterceptorCounter counter); }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityDestroyed(Activity activity) { this.counter.updateCounter(activity, false); } NotificationActivityLifecycleListener(@NonNull final NotificationPressedInterceptorCounter counter); @Override void onActivityCreated(Activity activity, Bundle savedInstanceState); @Override void onActivityStarted(final Activity activity); @Override void onActivityResumed(Activity activity); @Override void onActivityPaused(Activity activity); @Override void onActivityStopped(final Activity activity); @Override void onActivitySaveInstanceState(Activity activity, Bundle outState); @Override void onActivityDestroyed(Activity activity); }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityDestroyed(Activity activity) { this.counter.updateCounter(activity, false); } NotificationActivityLifecycleListener(@NonNull final NotificationPressedInterceptorCounter counter); @Override void onActivityCreated(Activity activity, Bundle savedInstanceState); @Override void onActivityStarted(final Activity activity); @Override void onActivityResumed(Activity activity); @Override void onActivityPaused(Activity activity); @Override void onActivityStopped(final Activity activity); @Override void onActivitySaveInstanceState(Activity activity, Bundle outState); @Override void onActivityDestroyed(Activity activity);  }