title: onActivityResult does not call and Fragment close itself from image picker Android
body: <p>Hi I know there is so much question related to this but still i can not find right way :(</p>
  
  <p>I read this link <a href="https://stackoverflow.com/questions/6147884/onactivityresult-not-being-called-in-fragment/#24303360">onActivityResult is not being called in Fragment</a> but i can not find the solution.</p>
  
  <pre><code>              Intent intent = new Intent();
                intent.setType("image/*");
                intent.setAction(Intent.ACTION_GET_CONTENT);
                startActivityForResult(Intent.createChooser(intent, ""),
                                      PICK_IMAGE);
  
  
          public void onActivityResult(int requestCode, int resultCode, Intent data) {
                  super.onActivityResult(requestCode, resultCode, data);
                  if (resultCode != Activity.RESULT_CANCELED) {
                      if (requestCode == PICK_IMAGE &amp;&amp; data.getData() != null) {
                          imagePath = getAbsolutePath(data.getData());
  
                          imageLoader.loadImage("file://" + imagePath,
                                  new ImageLoadingListener() {
  
                                      @Override
                                      public void onLoadingStarted(String imageUri,
                                              View view) {
  
                                      }
  
                                      @Override
                                      public void onLoadingFailed(String imageUri,
                                              View view, FailReason failReason) {
  
                                      }
  
                                      @Override
                                      public void onLoadingComplete(String imageUri,
                                              View view, Bitmap loadedImage) {
                                          height = loadedImage.getHeight();
                                          width = loadedImage.getWidth();
                                          if (Utils
                                                  .validateImageSize(height, width,
                                                          getActivity(),
                                                          "Image size must be in 480 (width) &amp; 800 (height)    with PNG or JPG format"))
                                              imageLoader.displayImage("file://"
                                                      + imagePath, ivSubmitImgWord,
                                                      options);
                                      }
  
                                      @Override
                                      public void onLoadingCancelled(String imageUri,
                                              View view) {
                                      }
                                  });
  
                      }
                  }
  
              }
  </code></pre>
  
  <p>when i choose image from gallery sometimes onActivityResult is not call and Fragment is close.please anybody can help me to solve this problem.</p>