I am new to android development, and I am creating my first android application, Little bit about the app, It is Drawing App, but I have also added outlined images to the app loading the images into a GridView, I want the user to select the image so that the image comes back to the drawing view activity and user can paint over it. below Is my code that I am using... I am stuck, as when I select image from the grid view the selected image does not appear onto the drawing view. How to do that ?
This is MainActivity.class where the drawing view and behind it imageview is placed
`Intent imagePickIntent = new Intent(MainActivity.this, GalleryView.class);
imagePickIntent.setType("image/*");
imagePickIntent.setAction(Intent.ACTION_PICK);
startActivityForResult(imagePickIntent, SELECT_PHOTO);`
This is GalleryView which has grid view in it where array of images are stored
final GridView gridview = (GridView) findViewById(R.id.selectGridView);
gridview.setAdapter(new SelectImageAdapter(this));
gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Intent intent = new Intent(GalleryView.this, MainActivity.class);
startActivity(intent);
Toast.makeText(GalleryView.this, "" + position,
Toast.LENGTH_SHORT).show();
Please help in selecting the image from the grid view, that after user selects the image the image should appear in the Main Activity to colour on to.
Thank you