Example usage for android.app Fragment startActivityForResult

List of usage examples for android.app Fragment startActivityForResult

Introduction

In this page you can find the example usage for android.app Fragment startActivityForResult.

Prototype

public void startActivityForResult(Intent intent, int requestCode) 

Source Link

Document

Call Activity#startActivityForResult(Intent,int) from the fragment's containing Activity.

Usage

From source file:com.ez.gallery.ucrop.UCrop.java

/**
 * Send the crop Intent with a custom request code
 *
 * @param fragment    Fragment to receive result
 * @param requestCode requestCode for result
 *//*from  w w w  .ja  va  2  s .c o  m*/
public void start(@NonNull Context context, @NonNull android.support.v4.app.Fragment fragment,
        int requestCode) {
    fragment.startActivityForResult(getIntent(context), requestCode);
}

From source file:com.android.messaging.ui.UIIntentsImpl.java

@Override
public void launchDocumentImagePicker(final Fragment fragment) {
    final Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.putExtra(Intent.EXTRA_MIME_TYPES, MessagePartData.ACCEPTABLE_IMAGE_TYPES);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    intent.setType(ContentType.IMAGE_UNSPECIFIED);

    fragment.startActivityForResult(intent, REQUEST_PICK_IMAGE_FROM_DOCUMENT_PICKER);
}