Please help, I want an image crop activity before setting drawable to imageView. I want to set cropped image to imageView, selb is the same.. Here's my code
public void picselect(View view) {
Toast.makeText(this, "Select a Picture", Toast.LENGTH_SHORT).show();
//pic select intent
Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RESULT_LOAD_IMAGE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
/***
* i wish launch a crop activity then set cropped image to the imageView
***/
//setting image to imageView
imageView = (ImageView) findViewById(R.id.imageView);
imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
//setting image to selb
ImageView selb = (ImageView) findViewById(R.id.contimg);
selb.setImageBitmap(BitmapFactory.decodeFile(picturePath));
}
}
please help quick. Thanks.