Example usage for android.app DialogFragment onActivityResult

List of usage examples for android.app DialogFragment onActivityResult

Introduction

In this page you can find the example usage for android.app DialogFragment onActivityResult.

Prototype

public void onActivityResult(int requestCode, int resultCode, Intent data) 

Source Link

Document

Receive the result from a previous call to #startActivityForResult(Intent,int) .

Usage

From source file:com.mods.grx.settings.GrxSettingsActivity.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    boolean error = false;
    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
        case Common.REQ_CODE_GALLERY_IMAGE_PICKER_FROM_FRAGMENT:
            String dest_fragment_tag = data.getStringExtra(Common.TAG_DEST_FRAGMENT_NAME_EXTRA_KEY);
            DialogFragment dialogFragment = null;
            if (dest_fragment_tag != null) {
                dialogFragment = (DialogFragment) getFragmentManager().findFragmentByTag(dest_fragment_tag);
                if (dialogFragment != null)
                    dialogFragment.onActivityResult(requestCode, resultCode, data);
            }/*www .jav  a 2 s  .  c o  m*/
            break;
        case Common.REQ_CODE_GALLERY_IMAGE_PICKER_FROM_GRXAJUSTES:
            String sFile = data.getStringExtra(GrxImagePicker.S_DIR_IMG);
            if (sFile != null) {
                save_and_configure_header_image(sFile);
            } else
                show_snack_message("IMG ERROR!!");
            break;
        case Common.REQ_CODE_GALLERY_IMAGE_PICKER_JUST_URI:
        case Common.REQ_CODE_GALLERY_IMAGE_PICKER_CROP_CIRCULAR:
            if (PrefScreenFragment != null) {
                PrefScreenFragment.imager_picker_result(data, requestCode);
            }

            break;
        default:
            break;
        }
    } else
        super.onActivityResult(requestCode, resultCode, data);
}