i have the folloing code :

```
final Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView parent, View v, int position, long id) {

        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        Bitmap b = null;
        b=BitmapFactory.decodeResource(getResources(),*********);

        b.compress(CompressFormat.PNG, 0, outputStream);   
        AlertDialog.Builder builder = new AlertDialog.Builder(Edit.this);
        builder.setTitle("Comfirm");
        builder.setMessage("Do you want to choose this picture?");
        builder.setPositiveButton("Continue", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                                          image = outputStream.toByteArray();   

                  }                        
              });

```

As you see `*****` needs to be a int like `android.R.drawble.icon`. I want to store the picture when users clicks on the picture. How can I get the picture when the user clicks it?