Is it possible to capture image and show it on imageview without saving on the phone? It would best if it work from API level 18. Currently my code:
private void ImageSelection()
{
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, IMAGE_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IMAGE_REQUEST && resultCode == RESULT_OK && data != null)
{
Uri FilePath = data.getData();
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), FilePath);
mImageView.setImageBitmap(bitmap);
mImageView.setVisibility(View.VISIBLE);
mEditText.setVisibility(View.VISIBLE);
} catch (IOException e) {
e.printStackTrace();
}
}
if (TextUtils.isEmpty(mEditText.getText())){
mEditText.setError("Must!");
}
}