Your computer may be configured to automatically import photos and videos when it is connected with a USB cable to your phone. To only charge your phone, you can prevent it from connecting as a media device.
- Go to Settings > Storage.
- Touch > USB computer connection.
- Uncheck Media device and Camera.
Connect your phone and computer with a USB cable.
You'll see
in your notifications.
TipIf your phone is already connected to a computer via USB and you want to change the connection status to charge only, preventing file transfer, swipe the status bar down and touch the USB connection notification to change the settings.