[android] How to change Android usb connect mode to charge only?

I've seen HTC android devices have connect mode selection when connected to PC via usb line, while mine always pops up a USB massive storage device dialog with a button turn on massive storage, which is boring, because sometimes my line could be loose, and off/on randomly, so the pop up always show up suddenly and intrudes my input when I'm doing something else. Is the a way to fix this?

This question is related to android usb connect

The answer is


In your phone go to Settings->Connect to PC.

There you will see the option Default Connection Type. Select it and set it to your preference.


To change the connect mode selection try Settings -> Wireless & Networks -> USB Connection. You can shoose to Charging, Mass Storage, Tethered, and ask on connection.


Nothing worked until I went this way: Settings>Developer options>Default USB configuration now you can choose your default USB connection purpose.


I have been searching for this for ages on my CM 11 android phone, running kitkat.

Well.. finally I found it. It's hidden in a totally unintuitive location:

  1. Go to settings
  2. Go to storage
  3. Open the menu and choose USB computer connection

Here you can choose between Media Device (MTP), Camera (PTP) and Mass storage (UMS). Turn them all off to get it to charge only.

Sadly, if the option is not there, it is not supported by the phone. This seems to be the case for my HTC One (M7).


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to usb

Is there an equivalent of lsusb for OS X USB Debugging option greyed out "The semaphore timeout period has expired" error for USB connection How to change Android usb connect mode to charge only? Is it possible to program Android to act as physical USB keyboard? Why does adb return offline after the device string? Simple way to query connected USB devices info in Python? How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)? How to load my app from Eclipse to my Android phone instead of AVD Controlling a USB power supply (on/off) with Linux

Examples related to connect

node.js Error: connect ECONNREFUSED; response from server SQLPLUS error:ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA Vendor code 17002 to connect to SQLDeveloper Node.js connect only works on localhost How to change Android usb connect mode to charge only? "Cannot GET /" with Connect on Node.js Connect Android to WiFi Enterprise network EAP(PEAP) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Java URLConnection Timeout