I am working on a photo editor app in which after editing my picture I save it into my local storage. It is working fine till android 9 but not on android 10. It shows excep
Here is the best I could find: https://developer.android.com/training/data-storage/app-specific#external
Basically, you now use app-specific directories for your files. For example:
@Nullable
File getAppSpecificAlbumStorageDir(Context context, String albumName) {
// Get the pictures directory that's inside the app-specific directory on
// external storage.
File file = new File(context.getExternalFilesDir(
Environment.DIRECTORY_PICTURES), albumName);
if (file == null || !file.mkdirs()) {
Log.e(LOG_TAG, "Directory not created");
}
return file;
}