Android13: use new Image picker.
Part of
@@ -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);
}
