In my application I am fetching data using webservices.But when the server is down or not in active state it gives response code 500 and my application force close.
The problem is that you are creating a JSON object using a response which is empty or does not represent a json string.
So, you should create a JSON object based on your response if:
- the status code is 200 - the response is not empty - the response starts with '['