I have an app that shows pictures via ShareIntent. I have the correct code asking for storage permissions:
if (Build.VERSION.SDK_INT >= 23) {
if (getActivity().checkSelfPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
doThing()
} else {
ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
Toast.makeText(getActivity(), R.string.permission, Toast.LENGTH_LONG).show();
}
} else {
doThing()
}
A user reported that he on Android Marshmellow he can use my app for photos from the storage (so like phone storage, external storage), but it doesn't work when he shares from SD card (removable storage). Why could this be? I have also heard that accessing the SD card needs a special prompt (and have seen it in other apps), but why is that and how to do it?