onErrorResponse排球库

时间:2015-05-30 18:02:37

标签: android android-volley

这是一个问题。

我无法理解这个错误:

  

D / Volley:[1] 2.onErrorResponse:ProfileActivity

//check for available network
        if (networkInfo != null && networkInfo.isConnected()) {
            // Creating volley request obj
            JsonArrayRequest articleReq = new JsonArrayRequest(url_article,
                    new Response.Listener<JSONArray>() {

                        @Override
                        public void onResponse(JSONArray response) {
                            Log.d(TAG, response.toString());
                            // Parsing json
                            for (int i = 0; i < 7; 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:asd asd " + error.getMessage());
                    hidePDialog();

                }
            });
            AppController.getInstance().addToRequestQueue(articleReq);

        } else {
            hidePDialog();
            showAlertDialog();
            toTakeArticlesFromDB();
        }

这是我的logcat(某些部分),我的508错误只是一次,我不认为这是主要问题:

05-30 20:54:03.638  28264-28264/md.mybebe.mybebe D/dalvikvm﹕ GC_FOR_ALLOC freed 427K, 13% free 3992K/4579K, paused 78ms
05-30 20:54:04.509  28264-28264/md.mybebe.mybebe D/libEGL﹕ loaded /system/lib/egl/libGLES_android.so
05-30 20:54:04.529  28264-28264/md.mybebe.mybebe D/libEGL﹕ loaded /system/lib/egl/libEGL_adreno200.so
05-30 20:54:04.559  28264-28264/md.mybebe.mybebe D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_adreno200.so
05-30 20:54:04.569  28264-28264/md.mybebe.mybebe D/libEGL﹕ loaded /system/lib/egl/libGLESv2_adreno200.so
05-30 20:54:04.699  28264-28264/md.mybebe.mybebe I/Adreno200-EGLSUB﹕ <ConfigWindowMatch:2078>: Format RGBA_8888.
05-30 20:54:04.729  28264-28264/md.mybebe.mybebe D/OpenGLRenderer﹕ Enabling debug mode 0
05-30 20:54:04.769  28264-28264/md.mybebe.mybebe D/memalloc﹕ /dev/pmem: Unmapping buffer base:0x5307a000 size:8110080 offset:7802880
05-30 20:54:04.829  28264-28264/md.mybebe.mybebe I/Adreno200-EGLSUB﹕ <ConfigWindowMatch:2078>: Format RGBA_8888.
05-30 20:54:05.350  28264-28264/md.mybebe.mybebe D/OpenGLRenderer﹕ has fontRender patch
05-30 20:54:13.928  28264-28264/md.mybebe.mybebe D/Volley﹕ [1] 2.onErrorResponse: ProfileActivity
05-30 20:54:13.938  28264-28264/md.mybebe.mybebe D/Volley﹕ [1] Request.finish: 11294 ms: [ ] http://arcadii.byethost13.com/MyBebe/articles.php 0xd2e29c5c NORMAL 1

0 个答案:

没有答案