Whenever my device (Nexus 5, Android M Preview 3) connects via USB, the USB config always defaults to "charging only".
This is quite problematic because the USB port on my device is faulty and sometimes disconnects and reconnects when bumped and so I have to manually change the mode to MTP (media transfer protocol) from the notification drawer each time.
- Debugging mode is enabled
- Develop settings -> USB Configuration is set to MTP.
I just tried this on my Nexus 5 (Android 6.0.1) and it worked:
The trick was to have a phone disconnected from USB. I guess the idea behind such a behavior was that if you set an USB connection type while your phone is not connected to any device, it will be treated as a default behavior.
This is a major problem for a layman to use. To access the files on your PC you need to follow the steps mentioned below:
Primarily this should solve the problem. But, if this DOES NOT solve the problem, then follow the following steps.
Now connect your device to your PC and you should be ready to go.
You have to follow these steps only once, however, you need to select the type of connection every time by swiping down on screen and selecting the option "MTP".
Hope this helps...!
By Default, Android 6.0 does not provide an automated method to select MTP when the device is connected as USB. After much wait and research through XDA, blogs, stackoverflow etc, the best solution I found to this was a small application, named MTP enabler PRO Marshmallow(4.5 MB) - built by one of the users to overcome this problem.
Below is a link to download the APK file.
http://forum.xda-developers.com/android/apps-games/app-mtp-enbaler-t3263467
Below is a link to the app in PlayStore(paid app)
https://play.google.com/store/apps/details?id=mtp_enabler.esolutions4you.de.mtpenabler&hl=en
Hope it helped.