如何在片段中调用public static void startPhotoPickActivity(Fragment fragment, EZPhotoPickConfig config)
?
public static void startPhotoPickActivity(Fragment fragment, EZPhotoPickConfig config) throws PhotoIntentException {
Activity activity = fragment.getActivity();
if(activity == null){
throw new PhotoIntentException("Can not find the host activity of fragment");
}
Intent intent = new Intent(fragment.getContext(), PhotoIntentHelperActivity.class);
int orientation = getScreenOrientation(activity);
intent.putExtra(PhotoIntentConstants.PHOTO_PICK_CONFIG_KEY, config);
intent.putExtra(PhotoIntentConstants.SCREEN_ORIENTATION, orientation);
int requestCode = config.photoSource == PhotoSource.GALLERY ? PHOTO_PICK_GALLERY_REQUEST_CODE : PHOTO_PICK_CAMERA_REQUEST_CODE;
fragment.startActivityForResult(intent, requestCode);
activity.overridePendingTransition(0, 0);
}