使用排球时出现unexpected end of stream on Connection
错误。
我正在寻找,但我找不到解决方案:
if (ConnectedToInternet.is(getActivity())) {
String tag_string_req = "news";
String url = ExtraMthd.BASE_API + "news.php?news&from=" + (refresh ? 0 : newss.size()) + "&isadmin=" + (Admin ? 1 : 0);
progressBar.setVisibility(View.VISIBLE);
JsonArrayRequest req = new JsonArrayRequest(url,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Log.d("news fragment", response.toString());
progressBar.setVisibility(View.INVISIBLE);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("news fragment", "Error: " + error.getMessage());
ExtraMthd.toast(getActivity(), "خطایی رخ داد؛\n" + error.getMessage());
progressBar.setVisibility(View.INVISIBLE);
}
});
App.getInstance().addToRequestQueue(req, tag_string_req);
}
错误:
D/news fragment: Error: java.io.IOException: unexpected end of stream on Connection{ardakantennis.ir:80, proxy=DIRECT@ hostAddress=158.58.185.39 cipherSuite=none protocol=http/1.1} (recycle count=0)