title: Picking image from gallery in lollipop
body: <p>I am picking image from gallery,my code works well with kitkat but it's crashing in lollipop.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>    public static int LOAD_IMAGE_RESULTS = 1;
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          if(requestCode == LOAD_IMAGE_RESULTS &amp;&amp; data != null &amp;&amp; data.getData() != null) {
              Uri _uri = data.getData();
  
              //User had pick an image.
              Cursor cursor = getActivity().getContentResolver().query(_uri, new String[] { android.provider.MediaStore.Images.ImageColumns.DATA }, null, null, null);
              cursor.moveToFirst();
  
              //Link to the image
              final String imageFilePath = cursor.getString(0);
              Log.w("ImageFile",imageFilePath);
              cursor.close();
            }
  }
  </code></pre>
  
  <p>My code is crashing because <code>imageFilePath</code> is returning null.How can I resolve it ?</p>