I have an application that uses Internet connection but when there is no internet connection available the application stop responding. Can anyone help on how i can resolve this problem. What I have thought that i can display an error when there no internet connection available but I dont know the way to do it.
I have an application that uses Internet connection but when there is no internet
Share
Check out my HTTPclass.java class, how I did that, I have a method connect(url) that takes a String of url and connects it, if connection is received it responds and gives the
responseCode = 200orHTTP.OK, and if the connection is not connected I handle a catch block and set theresponseCode = -1which means its not connected.So, you can do something like that only. When responsecode is -1 you can show the Message that “Internet Not Connected”.