This was a strange problem for me. I am not a Java or Android developer but had to create a small Android app to test something. I noticed that no internet connection was available to the emulated device.
After to Googling and wondering I realized that the solution was to:
Disable my ethernet card from my laptop, then restart my emulator. This I had to do because for some reason the emulator or Android studio doesn’t recognize a WiFi card as the primary connection if you have both the ethernet card and the WiFi card enabled. Might be a configuration in Android Studio for make this work but I had to do it from Windows Control Panel: Control Panel\Network and Internet\Network Connections