@Test public void register_shouldEnableReceivingBroadcasts() throws Exception { subject.register(context); Intent intent = getIntentForActionAndIdentifier(ACTION_INTERSTITIAL_SHOW, broadcastIdentifier); ShadowLocalBroadcastManager.getInstance(context).sendBroadcast(intent); verify(customEventInterstitialListener).onInterstitialShown(); }
public void register(Context context) { mContext = context; LocalBroadcastManager.getInstance(mContext).registerReceiver(this, sIntentFilter); }
EventForwardingBroadcastReceiver extends BroadcastReceiver { public void register(Context context) { mContext = context; LocalBroadcastManager.getInstance(mContext).registerReceiver(this, sIntentFilter); } }
EventForwardingBroadcastReceiver extends BroadcastReceiver { public void register(Context context) { mContext = context; LocalBroadcastManager.getInstance(mContext).registerReceiver(this, sIntentFilter); } EventForwardingBroadcastReceiver(CustomEventInterstitialListener customEventInterstitialListener, final long broadcastIdentifier); }
EventForwardingBroadcastReceiver extends BroadcastReceiver { public void register(Context context) { mContext = context; LocalBroadcastManager.getInstance(mContext).registerReceiver(this, sIntentFilter); } EventForwardingBroadcastReceiver(CustomEventInterstitialListener customEventInterstitialListener, final long broadcastIdentifier); static IntentFilter getHtmlInterstitialIntentFilter(); @Override void onReceive(Context context, Intent intent); void register(Context context); void unregister(); }
EventForwardingBroadcastReceiver extends BroadcastReceiver { public void register(Context context) { mContext = context; LocalBroadcastManager.getInstance(mContext).registerReceiver(this, sIntentFilter); } EventForwardingBroadcastReceiver(CustomEventInterstitialListener customEventInterstitialListener, final long broadcastIdentifier); static IntentFilter getHtmlInterstitialIntentFilter(); @Override void onReceive(Context context, Intent intent); void register(Context context); void unregister(); static final String ACTION_INTERSTITIAL_FAIL; static final String ACTION_INTERSTITIAL_SHOW; static final String ACTION_INTERSTITIAL_DISMISS; static final String ACTION_INTERSTITIAL_CLICK; }