@Test public void testCreateNearbyIntent() { Intent intent = NearbyService.createNearbyIntent(NearbyService.ACTION_START, ApplicationProvider.getApplicationContext()); assertEquals(NearbyService.ACTION_START, intent.getAction()); controller = Robolectric.buildService(TestService.class, intent); service = controller.create().get(); }
public static Intent createNearbyIntent(String state, Context context) { Intent intent = new Intent(context, NearbyService.class); intent.setAction(state); return intent; }
NearbyService extends IntentService { public static Intent createNearbyIntent(String state, Context context) { Intent intent = new Intent(context, NearbyService.class); intent.setAction(state); return intent; } }
NearbyService extends IntentService { public static Intent createNearbyIntent(String state, Context context) { Intent intent = new Intent(context, NearbyService.class); intent.setAction(state); return intent; } NearbyService(); }
NearbyService extends IntentService { public static Intent createNearbyIntent(String state, Context context) { Intent intent = new Intent(context, NearbyService.class); intent.setAction(state); return intent; } NearbyService(); static String[] getRequiredPermissions(); @Override int onStartCommand(@Nullable Intent intent, int flags, int startId); void notify(String message); NearbyState getServiceState(); void setServiceState(NearbyState state, @Nullable String message); static Intent createNearbyIntent(String state, Context context); void handleResponse(boolean error, String message); void handlePayload(Payload payload); void handlePayloadTransferUpdate(PayloadTransferUpdate update); void start(); void stop(); void setNearbyCode(String code); String getNearbyCode(); void sendBroadcastMessage(String message); }
NearbyService extends IntentService { public static Intent createNearbyIntent(String state, Context context) { Intent intent = new Intent(context, NearbyService.class); intent.setAction(state); return intent; } NearbyService(); static String[] getRequiredPermissions(); @Override int onStartCommand(@Nullable Intent intent, int flags, int startId); void notify(String message); NearbyState getServiceState(); void setServiceState(NearbyState state, @Nullable String message); static Intent createNearbyIntent(String state, Context context); void handleResponse(boolean error, String message); void handlePayload(Payload payload); void handlePayloadTransferUpdate(PayloadTransferUpdate update); void start(); void stop(); void setNearbyCode(String code); String getNearbyCode(); void sendBroadcastMessage(String message); static final String TAG; static final String ACTION_START; static final String ACTION_STOP; static final String VIDEO_START; }