아래의 코드가 ucrop 라이브러리에서 사용되었으며 자르기 창이 나타납니다.Ucrop onActivityMethod가 작동하지 않습니다.
Uri destinationUri = Uri.fromFile(new File(myContext.getCacheDir(), "IMG_" + System.currentTimeMillis()));
UCrop.of(sourceUri, destinationUri)
.withMaxResultSize(maxWidth, maxHeight)
.start(myContext);
그러나 컨트롤은 onActivityResult 메소드 내부에 없습니다./Else가 작동하지 않는 경우.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK && requestCode == UCrop.REQUEST_CROP) {
final Uri resultUri = UCrop.getOutput(data);
} else if (resultCode == UCrop.RESULT_ERROR) {
final Throwable cropError = UCrop.getError(data);
}
}
어떤 아이디어가 잘못 되었나요?
자르려는 어떤 고정 된 비율은 있는가? ** 16 : 9, 4 : 3, 1 : 1 ** –