I am using an image background remover library from GitHub. My image is not being saved in storage after done with removing background.
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CutOut.CUTOUT_ACTIVITY_REQUEST_CODE) {
switch (resultCode) {
case Activity.RESULT_OK:
Uri imageUri = CutOut.getUri(data);
// Save the image using the returned Uri here
//what code to add here so i can save my image
how to save image using Retun Uri
Intent intent1=new Intent(BackgroundRemover.this,MainActivity.class);
startActivity(intent1);
break;
case CutOut.CUTOUT_ACTIVITY_RESULT_ERROR_CODE:
Exception ex = CutOut.getError(data);
break;
default:
System.out.print("User cancelled the CutOut screen");
Intent intent2=new Intent(BackgroundRemover.this,AdvanceFeatures.class);
startActivity(intent2);
}
}
}
How to save image using return Uri?