Code example for ServiceConnection

Methods: onServiceDisconnected

0
    public void unbindService(final ServiceConnection serviceConnection) {
        unboundServiceConnections.add(serviceConnection);
        shadowOf(Looper.getMainLooper()).post(new Runnable() {
            @Override 
            public void run() { 
                serviceConnection.onServiceDisconnected(componentNameForBindService);
            } 
        }, 0); 
    } 
 
    public List<ServiceConnection> getUnboundServiceConnections() {
        return unboundServiceConnections;
    } 
    /** 
     * Consumes the most recent {@code Intent} started by {@link #startActivity(android.content.Intent)} and returns it. 
     * 
     * @return the most recently started {@code Intent} 
     */ 
    @Override 
    public Intent getNextStartedActivity() {
        if (startedActivities.isEmpty()) {