@Test public void onActivityStarted() throws Exception { final Activity mockActivity = mock(Activity.class); notificationActivityLifecycleListener.onActivityStarted(mockActivity); verify(mockActivity).registerReceiver(any(NotificationMessageReceiver.class), any(IntentFilter.class)); }
@Override public void onActivityStarted(final Activity activity) { activity.registerReceiver(foregroundNotificationReceiver, NotificationMessageReceiver.getMainPriorityFilter()); }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityStarted(final Activity activity) { activity.registerReceiver(foregroundNotificationReceiver, NotificationMessageReceiver.getMainPriorityFilter()); } }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityStarted(final Activity activity) { activity.registerReceiver(foregroundNotificationReceiver, NotificationMessageReceiver.getMainPriorityFilter()); } NotificationActivityLifecycleListener(@NonNull final NotificationPressedInterceptorCounter counter); }
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityStarted(final Activity activity) { activity.registerReceiver(foregroundNotificationReceiver, NotificationMessageReceiver.getMainPriorityFilter()); } 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 onActivityStarted(final Activity activity) { activity.registerReceiver(foregroundNotificationReceiver, NotificationMessageReceiver.getMainPriorityFilter()); } 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);  }