Adding an on touch coordinate and pixel color display
<p>My current code allows you to take an image and display it inside an image view. How would I implement the ability to touch anywhere on the image and display the color at that pixel, the color would then fill a solid object such as a rectangle to display what it is. I'm hoping the solution contains RGB values as i need them for my application later on.   </p>

<pre><code>import android.app.Activity;
    import android.content.Intent;
    import android.graphics.drawable.Drawable;
    import android.net.Uri;
    import android.os.Bundle;
    import android.os.Environment;
    import android.provider.MediaStore;
    import android.view.View;
    import android.widget.Button;
    import android.widget.ImageView;


    import java.io.File;

    public class MainActivity extends Activity {

        private static final int CONTENT_REQUEST = 1337;
        private File output = null;
        Button button;
        ImageView imageView;


        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            button = (Button) findViewById(R.id.CameraButton);
            imageView = (ImageView) findViewById(R.id.Image_view);
            button.setOnClickListener(new View.OnClickListener() {


                public void onClick(View v) {

                    Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                    File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);

                    output = new File(dir, "COMP4Image.jpeg");
                    i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(output));

                    startActivityForResult(i, CONTENT_REQUEST);

                }

            });
        }

        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + "/COMP4Image.jpeg";
            imageView.setImageDrawable(Drawable.createFromPath(path));
        }


    }
</code></pre>