title: Two onActivityResults in one activity
body: <p>Do you know how to handle two <code>onActivityResult()</code>s in one activity?</p>
  
  <p>I need to use my camera and search for my photos in one activity.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
          public static final int REQUEST_CAPTURE = 1;
  
          Button button_Vyber_Fotku, button_Fotak;
  
          ImageView imageView_VyberFotku, imageView_Fotak;
          private static final int PICK_IMAGE = 100;
          Uri imageUri_vybrana;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
  
              imageView_VyberFotku = (ImageView) findViewById(R.id.imageView_VyberFotku);
              button_Vyber_Fotku = (Button) findViewById(R.id.button_Vyber_Fotku);
  
              imageView_Fotak = (ImageView) findViewById(R.id.imageView_Fotak);
              button_Fotak = (Button) findViewById(R.id.button_fotak);
  
              if (!hasCamera())
              {
                  button_Fotak.setEnabled(false);
              }
  
          }
  
             public void Vyber_fotku_clicked(View v)
             {
                 openGallery();
             }
          private void openGallery()
          {
              Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
              startActivityForResult(gallery, PICK_IMAGE);
          }
  
          @Override
          protected void onActivityResult(int requestCode, int resultCode, Intent data) {
              super.onActivityResult(requestCode, resultCode, data);
              if (resultCode == RESULT_OK &amp;&amp; requestCode == PICK_IMAGE){
                  imageUri_vybrana = data.getData();
                  imageView_VyberFotku.setImageURI(imageUri_vybrana);
              }
          }
  
          public boolean hasCamera()
          {
              return getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
          }
  
          public void PouzijFotakClicked(View v)
          {
              Intent vyfot = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(vyfot , REQUEST_CAPTURE);
          }
  
  
          @Override
          protected void onActivityResult(int requestCode1, int resultCode1, Intent data1)
          {   if (requestCode1 == REQUEST_CAPTURE &amp;&amp; resultCode1 == RESULT_OK)
              {
                  Bundle extras = data1.getExtras();
                  Bitmap photo = (Bitmap) extras.get("data1");
                  imageView_Fotak.setImageBitmap(photo);
              }
          }
  
      }
  </code></pre>