title: Empty Cursor query MediaStore.Images.Media
body: <p>I try to get a cursor with ALL the images provided by MediaStore.Images.Media with a contentResolver, but the cursor is empty ! (I tried it on my phone with lots of images). The code is :</p>
  
  <p>public class MainActivity extends ActionBarActivity {</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      Button buttonLoadImage = (Button) findViewById(R.id.buttonLoadPicture);
      buttonLoadImage.setOnClickListener(new View.OnClickListener() {
          @SuppressLint("NewApi")
          @Override
          public void onClick(View arg0) {
              String[] filePathColumn = { MediaStore.Images.Media.DATA };
              Cursor cursor = getContentResolver().query(MediaStore.Images.Media.INTERNAL_CONTENT_URI, filePathColumn, null,null,null);
  
              if(cursor.moveToFirst()==false) Log.i("my message","EMPTY");
  
              int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
  
  
              String picturePath = cursor.getString(columnIndex); 
              cursor.close();
              ImageView imageView = (ImageView) findViewById(R.id.imgView);
              imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
          }
      });
  }
  </code></pre>
  
  <p>Do you know how to have at least a not empty cursor? Thanks a lot</p>