Skip to content

Commit

Permalink
return from result to first activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Legementarion committed Mar 22, 2018
1 parent 6b16bc5 commit 615fd91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void onCreate(Bundle savedInstanceState) {
UCrop uCrop = UCrop.of(inputUri, outputUri);
setupViews(bundles);

fragment = uCrop.getFragment(bundles, this);
fragment = uCrop.getFragment(bundles, this); //set params from previous activity and get ucrop fragment
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, fragment, UCropFragment.TAG)
.commit();
Expand Down Expand Up @@ -180,6 +180,7 @@ public void onCropFinish(UCropFragment.UCropResult result) {
break;

}
finish();
}

private void handleCropResult(@NonNull Intent result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_result);

try {
UCropView uCropView = (UCropView) findViewById(R.id.ucrop);
UCropView uCropView = findViewById(R.id.ucrop);
uCropView.getCropImageView().setImageUri(getIntent().getData(), null);
uCropView.getOverlayView().setShowCropFrame(false);
uCropView.getOverlayView().setShowCropGrid(false);
Expand Down Expand Up @@ -161,7 +161,7 @@ private void showNotification(@NonNull File file) {
List<ResolveInfo> resInfoList = getPackageManager().queryIntentActivities(
intent,
PackageManager.MATCH_DEFAULT_ONLY);
for(ResolveInfo info: resInfoList) {
for (ResolveInfo info : resInfoList) {
grantUriPermission(
info.activityInfo.packageName,
fileUri, FLAG_GRANT_WRITE_URI_PERMISSION | FLAG_GRANT_READ_URI_PERMISSION);
Expand Down

0 comments on commit 615fd91

Please sign in to comment.