title: CropActivity doesn't open after picking image
body: <p>I tired to do same as in <a href="https://www.simplifiedcoding.net/crop-image-android-tutorial/" rel="nofollow noreferrer">https://www.simplifiedcoding.net/crop-image-android-tutorial/</a>. Pick image from gallary and after crop it. But when i'm included it to my fragment it's open gallary but after doesn't show crop activity. But when i did the same directly in activity its work! </p>
  
  <p>My fragment onViewCreated</p>
  
  <pre><code>    @Override
      public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
          SetupUI(view);
          SetupProfile();
          storage = FirebaseStorage.getInstance();
          storageReference = storage.getReference();
          FragmentAdapterProfile adapter = new FragmentAdapterProfile(getActivity(), getActivity().getSupportFragmentManager());
          // Set the adapter onto the view pager
          pager.setAdapter(adapter);
          // Give the TabLayout the ViewPager
          TabLayout tabLayout = (TabLayout) view.findViewById(R.id.profileTabs);
          tabLayout.setupWithViewPager(pager);
          tabLayout.getTabAt(0).setText("About");
          tabLayout.getTabAt(1).setText("Setting");
          tabLayout.getTabAt(2).setText("Post");
          changeavatar.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                      onSelectImageClick(v);
              }
          });
      }
  </code></pre>
  
  <p>The picking </p>
  
  <pre><code>public void onSelectImageClick(View view) {
          CropImage.startPickImageActivity((Activity) context);
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
  
          // handle result of pick image chooser
          if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE &amp;&amp; resultCode == Activity.RESULT_OK) {
              Uri imageUri = CropImage.getPickImageResultUri(context, data);
  
              // For API &gt;= 23 we need to check specifically that we have permissions to read external storage.
              if (CropImage.isReadExternalStoragePermissionsRequired(context, imageUri)) {
                  // request permissions and handle the result in onRequestPermissionsResult()
                  mCropImageUri = imageUri;
                  requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0);
              } else {
                  // no permissions required or already grunted, can start crop image activity
                  startCropImageActivity(imageUri);
              }
          }
  
          // handle result of CropImageActivity
          if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
              CropImage.ActivityResult result = CropImage.getActivityResult(data);
              if (resultCode == RESULT_OK) {
                  avatar.setImageURI(result.getUri());
                  Toast.makeText(context, "Cropping successful, Sample: " + result.getSampleSize(), Toast.LENGTH_LONG).show();
              } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
                  Toast.makeText(context, "Cropping failed: " + result.getError(), Toast.LENGTH_LONG).show();
              }
          }
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
          if (mCropImageUri != null &amp;&amp; grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
              // required permissions granted, start crop image activity
              startCropImageActivity(mCropImageUri);
          } else {
              Toast.makeText(context, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
          }
      }
  
      /**
       * Start crop image activity for the given image.
       */
      private void startCropImageActivity(Uri imageUri) {
          CropImage.activity(imageUri)
                  .setGuidelines(CropImageView.Guidelines.ON)
                  .setMultiTouchEnabled(true)
                  .setAspectRatio(1,1)
                  .start((Activity) context);
      }
  </code></pre>