这是一个问题。
我无法理解这个错误:
D / Volley:[1] 3.onErrorResponse:ProfileActivity
请求已完成,但没有一些数据。并且一旦看到这个错误:
[61818] BasicNetwork.performRequest:http://arcadii.byethost13.com/MyBebe/articles.php的意外响应代码508
private void JSONrequest(){
// Creating volley request obj
userDB = sqlHelper.getWritableDatabase();
JsonArrayRequest movieReq = new JsonArrayRequest(url_article,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
// Parsing json
for (int i = 0; i < 10; i++) {
try {
JSONObject obj = response.getJSONObject(i);
String description = Html.fromHtml(obj.getString("descriere")).toString();
String shortDescription = description.substring(1, 250) + "...";
ContentValues cv = new ContentValues();
cv.put(UserDataHelper.NAME, obj.getString("nume"));
cv.put(UserDataHelper.shortDESCRIPTION, shortDescription);
cv.put(UserDataHelper.longDESCRIPTION, description);
cv.put(UserDataHelper.PHOTO, "http://mybebe.md/foto/articole/" + obj.getString("foto"));
Log.d(obj.getString("descriere"), obj.getString("foto"));
boolean db_error = false;
Cursor cursor = userDB.query(UserDataHelper.TABLE_NAME, new String[]{
UserDataHelper.AID, UserDataHelper.NAME}, null,
null,
null,
null,
null
);
while (cursor.moveToNext()) {
String name = cursor.getString(cursor
.getColumnIndex(UserDataHelper.NAME));
if (name.equals(cv.get(UserDataHelper.NAME))) {
db_error = true;
}
}
cursor.close();
if (!db_error) {
userDB.insert(UserDataHelper.TABLE_NAME, null, cv);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
adapter.notifyDataSetChanged();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.d(TAG, "Error: " + error.getMessage());
hidePDialog();
}
});
AppController.getInstance().addToRequestQueue(movieReq);
toTakeArticlesFromDB();
}`
这是我的logcat(某些部分,我实际上并不知道如何将其粘贴到stackoverflow,对不起)而我的508错误只是一次,我不认为这是主要问题:
22249-22249/md.mybebe.mybebe D/memalloc? /dev/pmem: Unmapping buffer base:0x53067000 size:307200 offset:0
22249-22249/md.mybebe.mybebe I/Adreno200-EGLSUB? <ConfigWindowMatch:2078>: Format RGBA_8888.
22249-22249/md.mybebe.mybebe D/OpenGLRenderer? has fontRender patch
22249-22249/md.mybebe.mybebe D/Volley? [1] 3.onErrorResponse: ProfileActivity
22249-22249/md.mybebe.mybebe D/Volley? [1] Request.finish: 12516 ms: [ ] http://arcadii.byethost13.com/MyBebe/articles.php 0xd2e29c5c NORMAL 1