app/src/main/java/com/example/androidcomm/Case6Dialog.java
private void sendResult(String name) {
        Intent intent = new Intent();
        intent.putExtra(EXTRA_NAME, name);
/*
        if (getTargetFragment() == null) {
            // Send the data to the activity
            getActivity().setResult(getActivity().RESULT_OK, intent);
            return;
        }
*/
        // Send the data to the activity
        getTargetFragment().onActivityResult(getTargetRequestCode(), getActivity().RESULT_OK, intent);
    }
/**
     * sends the data to the onActivityResult() of the Activity host
     * @param name the name which comes back to the hosting fragment
     */
sends the data to the onActivityResult() of the Activity host
@param name the name which comes back to the hosting fragment
sends the data to the onActivityResult () of the Activity host @param name the name which comes back to the hosting fragment
private void sendResult(String name) {
        Intent intent = new Intent();
        intent.putExtra(EXTRA_NAME, name);
/*
        if (getTargetFragment() == null) {
            getActivity().setResult(getActivity().RESULT_OK, intent);
            return;
        }
*/
        getTargetFragment().onActivityResult(getTargetRequestCode(), getActivity().RESULT_OK, intent);
    }
private void sendResult ( String name ) { Intent intent = new Intent ( ) ; intent . putExtra ( EXTRA_NAME , name ) ; /*
        if (getTargetFragment() == null) {
            // Send the data to the activity
            getActivity().setResult(getActivity().RESULT_OK, intent);
            return;
        }
*/ getTargetFragment ( ) . onActivityResult ( getTargetRequestCode ( ) , getActivity ( ) . RESULT_OK , intent ) ; }
sends the data to the onActivityResult() of the Activity host
 @param name the name which comes back to the hosting fragment
sends the data to the onActivityResult () of the Activity host @param name the name which comes back to the hosting fragment
// Send the data to the activity