Use 10.0.2.2 for default AVD and 10.0.3.2 for Genymotion
| 
The localhost refers to the device on which the code is running, in this case the emulator. 
If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead. You can read more from here. | 
