Skip to content

Commit c1f37bc

Browse files
authored
Merge pull request #332 from Vantablack/fix-parcel
Fix class not found when unmarshalling for Samsung devices
2 parents 7c150ab + 2ead8ee commit c1f37bc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import android.graphics.RectF;
3131
import android.net.Uri;
3232
import android.os.Build;
33+
import android.os.Bundle;
3334
import android.os.Parcel;
3435
import android.os.Parcelable;
3536
import android.provider.MediaStore;
@@ -453,8 +454,10 @@ public Intent getIntent(@NonNull Context context, @Nullable Class<?> cls) {
453454

454455
Intent intent = new Intent();
455456
intent.setClass(context, cls);
456-
intent.putExtra(CROP_IMAGE_EXTRA_SOURCE, mSource);
457-
intent.putExtra(CROP_IMAGE_EXTRA_OPTIONS, mOptions);
457+
Bundle b = new Bundle();
458+
b.putParcelable(CROP_IMAGE_EXTRA_SOURCE, mSource);
459+
b.putParcelable(CROP_IMAGE_EXTRA_OPTIONS, mOptions);
460+
intent.putExtra("bundle", b);
458461
return intent;
459462
}
460463

cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImageActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public void onCreate(Bundle savedInstanceState) {
6262

6363
mCropImageView = (CropImageView) findViewById(R.id.cropImageView);
6464

65-
Intent intent = getIntent();
66-
mCropImageUri = intent.getParcelableExtra(CropImage.CROP_IMAGE_EXTRA_SOURCE);
67-
mOptions = intent.getParcelableExtra(CropImage.CROP_IMAGE_EXTRA_OPTIONS);
65+
Bundle bundle = getIntent().getBundleExtra("bundle");
66+
mCropImageUri = bundle.getParcelable(CropImage.CROP_IMAGE_EXTRA_SOURCE);
67+
mOptions = bundle.getParcelable(CropImage.CROP_IMAGE_EXTRA_OPTIONS);
6868

6969
if (savedInstanceState == null) {
7070
if (mCropImageUri == null || mCropImageUri.equals(Uri.EMPTY)) {

0 commit comments

Comments
 (0)