onImageclicklistener to upload images in another activity
<p>I have two activities. First activity is a layout to upload images inside. The second activity is an adapter and shows a image gallery for the uploads. I want to write a inner class onImageClickListener inside the Adapter to select images for the upload.</p>

<pre><code>class OnImageClickListener implements View.OnClickListener {

    int _position;

    //constructor
    public OnImageClickListener (int position) {
        _position = position;
    }

    @Override
    public void onClick(View v) {
        Intent i = new Intent(_activity, LayoutForThreeActivity.class);
    }
}
</code></pre>

<p>The clicklistener have to commit the selected image from the gallery on the LayoutForThreeActivity and show it into a imageView. How can i do this?</p>

<p>Here is the code from the LayoutForThreeActivity</p>

<pre><code> image1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(LayoutForThreeActivity.this, GridViewActivity.class);
            startActivityForResult(intent, RESULT_LOAD_IMAGE1);
            //Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            //startActivityForResult(intent, RESULT_LOAD_IMAGE1);
        }
    });

    image2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(intent, RESULT_LOAD_IMAGE2);
        }
    });

    image3.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(intent, RESULT_LOAD_IMAGE3);
        }
    });

    save.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(LayoutForThreeActivity.this, SaveCompositionActivity.class);
            startActivity(intent);
           //Toast.makeText(getApplicationContext(), "Save", Toast.LENGTH_LONG).show();
        }
    });

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);


    if (requestCode == RESULT_LOAD_IMAGE1 &amp;&amp; resultCode == RESULT_OK &amp;&amp; null != data) {


        //Todo


    }

    if (requestCode == RESULT_LOAD_IMAGE2 &amp;&amp; resultCode == RESULT_OK &amp;&amp; null != data) {


        //Todo

    }

    if (requestCode == RESULT_LOAD_IMAGE3 &amp;&amp; resultCode == RESULT_OK &amp;&amp; null != data) {


        //Todo

    }

}
</code></pre>