You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Connection.java Class there is an AsyncTask called Task, there is where the POST request is triggered. There is a try-catch there that if the request fails it throws a new RuntimeException, but this exception is never handled and it causes my app to crash.
The text was updated successfully, but these errors were encountered:
It isn't even printing the stackTrace, I had to debug to find out what was going on, and was there I noticed Genymotion for any reason didn't have internet connection.
I have the same problem. Have you found any work around? So, that app does not crash when there is no internet connection after triggering the request.
Use openConnection, starting from API22 and removed in API 23 i think
You could use okHttp but Android already uses it internally
Use the Volley library, great for this small Class, does everything for you, you should take a look (I assume you don't because you don't want to depend on a lib)
If you want to keep the Class on hand, than you should at least manage the Exception
Expand the Interface with a onRequestFailed() for example
Catch the Correct Exception and pass the error to the Listener so the developer can react, NEVER catch pure Exception - Bad habit.
I hope I could assist, let me know if you need anything else.
In Connection.java Class there is an AsyncTask called Task, there is where the POST request is triggered. There is a try-catch there that if the request fails it throws a new RuntimeException, but this exception is never handled and it causes my app to crash.
The text was updated successfully, but these errors were encountered: