My Samsung phone was not recognized by Android Studio on windows 7. I repaired it by installing the Samung Driver here: http://developer.samsung.com/technical-doc/view.do?v=T00
Here are few steps if your android phone create problem next time
I solved in following way:
Go to Settings->Developer options-> On top of the screen, turn on the button.
Now goto bottom on the debugging section.
Now turn on USB debugging option
It will ask some questions if you want to allow the PC to this device, press allow all time!
I had the same issue when connecting a SM-T113 to a Windows 7 PC. The problem was solved by installing Smart Switch.
Galaxy J7(2016) same problem solved when i go to software update section on phone. asked me to allow debug mode from this computer . Checked always trust this computer. and OK Note : Usb mode PTP