Is there any way to know(programmatically) in your Activity/Application that the user has connected your phone to PC through USB?
Manifest.xml:
MyReceiver:
public class MyReceiver extends BroadcastReceiver{ if (intent.getAction().equalsIgnoreCase( "android.intent.action.UMS_CONNECTED")) {...} }