Code example for ResultReceiver

Methods: send

0
        if (receiver != null) {
            if (data == null) {
                data = new Bundle();
            } 
 
            receiver.send(code, data);
        } 
    } 
 
    @Override 
    protected final void onHandleIntent(Intent intent) {
        Request request = intent.getParcelableExtra(INTENT_EXTRA_REQUEST);
        request.setClassLoader(getClassLoader());
 
        ResultReceiver receiver = intent.getParcelableExtra(INTENT_EXTRA_RECEIVER);
 
        Operation operation = getOperationForType(request.getRequestType());
        try { 
            sendSuccess(receiver, operation.execute(this, request));
        } catch (ConnectionException e) {
            DataDroidLog.e(LOG_TAG, "ConnectionException", e);