I am working on an application that needs to communicate with the server. Hence, the check for the internet connectivity is implemented.
The check works perfectly fine when I am working with mobile data and wifi.
The issue is my device is connected with hotspot. I click on the login button and get the progress bar that states "Connecting to the server". Now, I turn off the hotspot. But the wifi is enabled in my device.
(It simply fails to get any responseCode).
My application gets into the infinite state.
Any suggestions of how to overcome this problem.
Try out this code for internet checking:--