I am having a imageView in one class and on clicking the imageView a dialog box appear which has two option to take a image from camera or open the image gallery of device. I want to send image from one class to another so it can appear in ImageView. I am searching from many hour but i got only about sending text data from one class to another.Can any one tell about sending an image from one class to another?
This is code from sender class which will take image.
takeImg.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub if(event.getAction() == event.ACTION_UP) { i=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(i,cameraData); } return true; } }); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); if(resultCode==RESULT_OK) { Bundle extras=data.getExtras(); bmp=(Bitmap)extras.get("data"); } }
For any help thanks