title: Set Pixel of Bitmap caught by intent picker
body: <p>my little App causes a crash when I try to set the Pixels of an <strong>Bitmap loaded by the photopicker intent</strong> and I cant figure out why. For the intent I took <a href="https://stackoverflow.com/a/38352844/9942225" title="this code">this code</a>.</p>
  
  <p>So here is the important part of my current code:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
    private Bitmap selectedImage;
  
    ...
  
    private void changebitmap() {
  
          ImageView imageView = findViewById(R.id.imageView);
  
          for(int x = 0; x &lt; selectedImage.getWidth(); x++) {
              for(int y = 0; y &lt; selectedImage.getHeight(); y++) {
                  selectedImage.setPixel(x, y, Color.argb(255, 128, 128 ,128));
              }
          }
  
          imageView.setImageBitmap(selectedImage);
  
    }
  }
  </code></pre>
  
  <p>I can't figure out why it won't work.</p>
  
  <p>Regards</p>