On Android 6.0 and above you have to select USB connection type on your phone after you attached a computer or other device because the default USB connection type is charging.
You can do that when you plugged in your phone to your computer pull the phone's notification bar and tap on the appearing notification, something like this: USB for charging
and select the desired USB connection type - in your case: File transfer (aka MTP
).
There is a way to set the default USB connection type to MTP. You should enable Developer options
on your device and in it search Select USB Configuration
and set it to MTP
.