Code example for Messenger

Methods: send

0
 
        final Message m = Message.obtain();
        m.obj = result;
        m.what = resultCode;
        try { 
            messenger.send(m);
        } catch (RemoteException e) {
            // Couldn't report back, but there is nothing we can do to fix it 
        } 
    } 
 
    public void onClickCancel(final View v) {
        reportBackToCaller(CODE_CANCEL, null);
        finish();
    } 
 
    public void onClickConfirm(final View v) {
        final Bundle parameters = new Bundle();
        final int resultCode = mContents.apply(this, parameters);
        reportBackToCaller(resultCode, parameters);
Contextual code suggestions in your IDE  Get Codota for Java