JSONException: End of input at character 0

前端 未结 3 2039
心在旅途
心在旅途 2020-12-20 05:48

i am trying to get JSON values from server. I don\'t know what is wrong with my code. I am using AsyncTask and here is my code in doInBackground

3条回答
  •  感动是毒
    2020-12-20 06:16

    Check if the response is not empty before process the JSON:

    if (response.success()) {
        if (response.getData() == null) {
            return null;
        } else if (response.getData().length() <= 0){
            return null;
        }
    
        try {
            // Logic
    

提交回复
热议问题