title: startActivityForResult() for selecting image, why do I not get RESULT_OK?
body: <p>In my simple Activity I launch the selection of an image.</p>
  
  <p>On the result of the selection i want to show the image.</p>
  
  <p>But debugging I see that <code>resultCode == RESULT_OK</code> is not <code>true</code>.</p>
  
  <p>What am i doing wrong here???</p>
  
  <pre><code>public class PictureActivity extends Activity {
  private static final int SELECT_PICTURE = 1;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Intent intent = new Intent();
      intent.setAction(Intent.ACTION_GET_CONTENT);
      intent.setType("image/*");
      intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      startActivityForResult(intent, SELECT_PICTURE);
  }
  
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (resultCode == RESULT_OK) {
          if (requestCode == SELECT_PICTURE) {
  
              Intent intent = new Intent();
              intent.setAction(Intent.ACTION_VIEW);
              intent.setType("image/*");
              intent.setData(data.getData());
              intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              startActivity(intent);
          }
      }
  }
  }
  </code></pre>