title: Select Image from gallery in Android Fragment
body: <p>I want to select gallery intent in fragment.when user choose option to select image from gallery then gallery opens and immediately onActivityResult of fragment is being called.and when user pick image then onActivityResult() is not called.So i am not able to select image from gallery.
  Belo is my code to open gallery -</p>
  
  <pre><code>Intent intent = new   Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
      intent.setType("video/, images/");
      startActivityForResult(intent, 2);
  </code></pre>
  
  <p>and here is my onActivityResult-</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      Log.d(TAG, "onActivityResult"); // not printed
      Toast.makeText(mContext, "aaaa"+requestCode, Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>What the problem in my code.</p>
  
  <p>Thanks in advance.</p>