Am trying to capture 2 images with 1 button each per click
<p>here is my code;</p>

<pre><code>package com.example.camwork;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends Activity {
Button snap;
final int CAMERA_REQUEST2=1;
final int CAMERA_REQUEST3=1;
Bitmap bm, bm2,bitmap, bitmap2;
ImageView img,img2;
int clickTimes =0;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
//  snap=(Button) findViewById(R.id.btn_snap);
    img=(ImageView) findViewById(R.id.img);
    img=(ImageView) findViewById(R.id.img2);
    }
        public void doSomething(View v){
            if(v.getId()==R.id.btn_snap)
            {
              clickTimes++;
                switch(clickTimes) {
                    case 1:

                        Intent cameraIntent1 = new         
   Intent(MediaStore.ACTION_IMAGE_CAPTURE);

   startActivityForResult(cameraIntent1, CAMERA_REQUEST2);
        break;
                    case 2:


                        Intent cameraIntent = new   
   Intent(MediaStore.ACTION_IMAGE_CAPTURE);

startActivityForResult(cameraIntent, CAMERA_REQUEST3);
                        break;

            default: 
                 Toast.makeText(MainActivity.this,"You can take more than 2   
   images", Toast.LENGTH_SHORT).show();


        }
            }

}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    Toast.makeText(getBaseContext(), "no pic",Toast.LENGTH_SHORT).show();

    if (requestCode == CAMERA_REQUEST2) {  
          bm = (Bitmap) data.getExtras().get("data");    
 img.setImageBitmap(bm);
  }
    else if (requestCode == CAMERA_REQUEST3) {  
          bm2 = (Bitmap) data.getExtras().get("data"); 
 img2.setImageBitmap(bm2);
    }
    else{
 Toast.makeText(getBaseContext(), "no pic",Toast.LENGTH_SHORT).show();
    }
 }
</code></pre>

<p>it is working for the first case only and its keep looping it in every click.
Please help. And thanks a lot, you guys have being really help. I think its loosing count on the onActivityForResult() method but am not sure and I dont know any other way to capture images, please assist.</p>
