Yesterday I copied a few TV episodes to my phone's SD card, and now when I go to send a picture in Facebook Messenger, I'm swamped by those episodes. To fix this (i.e. to stop the videos showing in the Photos app and file pickers) I renamed the Videos folder on my SD card to .Videos (making it a hidden folder). Is there a better way to do this though? I don't need to lock them or hide hide them, I just don't want them to show in the gallery.
I'm on stock Android Oreo.
The solution to that is pretty easy: Instead of renaming the folder to
.Video (and thus "hiding" it completely), simply place a file named
.nomedia inside it. That way you hide it from the media scanner – while the directory stays visible in your file managers.
I cannot check with FB (refusing those data collectors), but apps usually depend on the "media provider" for such activities as you described. The "media provider" uses a database, so available media can be found quickly (if each app would scan your entire storage on a "share" action, that would take far too long). By placing a
.nomedia file inside a directory, you tell its scanner to skip that directory (and all its content including subdirectories) from being included with this database.