I am using this code:
MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "title" , "description");
and it is working well.
Problems:
- It is creating a folder called "Pictures" in gallery automatically. But I want different name, for example my app's name.
- insertImage() function of MediaStore is depreciated in android 10:
public static String insertImage (ContentResolver cr, String imagePath, String name, String description)
This method was deprecated in API level 29. inserting of images should be performed using MediaColumns#IS_PENDING, which offers richer control over lifecycle.
I have read the documentation and don't actually understand IS_PENDING and how to use it.