Code example for Messenger

Methods: send

        final Message m = Message.obtain();
        m.obj = result;
        m.what = resultCode;
        try { 
        } 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);
    public void onClickConfirm(final View v) {
        final Bundle parameters = new Bundle();
        final int resultCode = mContents.apply(this, parameters);
        reportBackToCaller(resultCode, parameters);
Experience pair programming with AI  Get Codota for Java