title: Fragment disappear after coming back from startActivityForResult
body: <p>i have a strange problem.</p>
  
  <p>i use nested fragment in my code,( 4 level )</p>
  
  <p>Home  -> Services ->  ServiceDetails -> Upload</p>
  
  <p>in the last fragment ( Upload Fragment ) i want to choose image from the gallery or the camera so i wrote the following code to pick the image :</p>
  
  <pre><code>switch (which) {
      case galleryItem:
          Intent intent = new Intent();
          intent.setType("image/*");
          intent.setAction(Intent.ACTION_GET_CONTENT);
          startActivityForResult(
                  Intent.createChooser(intent, “Select Album”,
                  Home.GALLERY_REQUEST);
          break;
  
      case cameraItem:
          Intent cameraIntent = new Intent(
                  android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
          startActivityForResult(cameraIntent,
                  Home.CAMERA_REQUEST);
          break;
  </code></pre>
  
  <p>and every thing is ok.
  i can get URI from the selected picture in <code>onActivityResult</code> of my fragment with the following code:</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
  
      super.onActivityResult(requestCode, resultCode, data);
      if (resultCode == Activity.RESULT_OK) {
          if (requestCode == Home.GALLERY_REQUEST) {
              Uri selectedImageUri = data.getData();
  
          } else if (requestCode == Home.CAMERA_REQUEST) {
              Bitmap photo = (Bitmap) data.getExtras().get("data");
              Uri cameraUri = getImageUri(
                      getActivity().getApplicationContext(), photo);
  
          }
      }
  }
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>if i open my album and scroll ( see all thumbnail ) in that, after selecting my picture <code>onActivityResult</code> called in the fragment but fragment is not visible any more and <code>Home</code> fragment ( first fragment ) be visible in my app.
  but if i open album ( by startActivityForResult ) and immediately select photo, all thing is going ok.</p>
  
  <p>i don’t any problem with camera. </p>
  
  <p>i searched a lot but don’t find any helpful data,
  if you want to see any part of my code tell me.
  i don’t get any crash just i lose my last fragment.
  thanks in advance.</p>