title: Blank image while picking image from gallery
body: <p>when my app runs for the first time and i try to select the image for user from  gallery , system asks for permission for accessing the photo gallery and when i allow the permission and try to pick the image the (from thumbnails) selected image appears as totally blank (or maybe its  totally black) once i restart the app this issue gets solved by itself any clue  why is this happening ?  </p>
  
  <p>when i try to access the gallery for first time  (and allow the permission ) 
  this is how my gallery looks like :</p>
  
  <p>totally normal</p>
  
  <p><a href="https://i.stack.imgur.com/aS9DN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aS9DN.png" alt="enter image description here"></a> </p>
  
  <p>when i select any of the images from thumbnail ,
  see there's nothing (totally blank)
  <a href="https://i.stack.imgur.com/BGmVH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BGmVH.png" alt="enter image description here"></a></p>
  
  <p>and if i select this (blank)image :</p>
  
  <p><a href="https://i.stack.imgur.com/LmI9n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LmI9n.png" alt="enter image description here"></a></p>
  
  <p>but once i restart the app 
  and select any of the images from thumbnail it works fine from now 
  <a href="https://i.stack.imgur.com/gOzmx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gOzmx.png" alt="enter image description here"></a></p>
  
  <p>if anybody faced similar scenario before then please let me know</p>
  
  <p>CODE:</p>
  
  <pre><code>userImageView.setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
  
  
      if (Build.VERSION.SDK_INT &gt;= 23){
  
  
          if (ContextCompat.checkSelfPermission(ProfileSetting.this,
                  Manifest.permission.READ_EXTERNAL_STORAGE)
                  != PackageManager.PERMISSION_GRANTED) {
  
              requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE},
                      REQUEST_CODE_ASK_PERMISSIONS);
  
          }else {
  
  
              //Start Activity To Select Image From Gallery
              Intent gallery_Intent = new Intent(ProfileSetting.this, GalleryUtil.class);
              gallery_Intent.putExtra("Switch", 0);
              startActivityForResult(gallery_Intent, GALLERY_ACTIVITY_CODE);
          }
  
  
      }else {
  
  
  
          //Start Activity To Select Image From Gallery
          Intent gallery_Intent = new Intent(ProfileSetting.this, GalleryUtil.class);
          gallery_Intent.putExtra("Switch", 0);
          startActivityForResult(gallery_Intent, GALLERY_ACTIVITY_CODE);
  
      }
  
  
  }
  });
  </code></pre>