Android13: use new Image picker.

Part of #1210.
This commit is contained in:
Dennis Guse
2022-07-01 12:30:25 +02:00
parent 49f86c4eb9
commit 3d6c339509
@@ -21,8 +21,10 @@ import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.util.Log;
import android.util.Pair;
import android.view.Menu;
@@ -232,7 +234,13 @@ public class MarkerEditActivity extends AbstractActivity {
}
private void createMarkerWithGalleryImage() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Intent intent;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, 1);
} else {
intent = new Intent(Intent.ACTION_GET_CONTENT);
}
intent.setType("image/*");
takePictureFromGallery.launch(intent);
}