ParseQueryException: Bad protocol (Android SDK)

淺唱寂寞╮ 提交于 2020-01-24 17:21:35

问题


I'm using Parse's Android SDK as my back-end, and sometimes the queries are taking a very long time, even when using my 100Mb WiFi connection, and even though I only have less than 10 Users and 30 records in all the Parse classes combined.

Sometimes I get the list (after a long time of waiting), but sometimes the error i receive is "ParseQueryException: Bad protocol"

Maybe my queries are to blame. Here's an example of a (usually) slow query, trying to find all my user's roommates, meaning, all the OTHER users who's HOME COLUMN points on the same home as the logged user:

ParseObject home = ParseObject.createWithoutData("Homes",ParseUser.getCurrentUser().getParseObject("home").getObjectId());
ParseQuery<ParseObject> query = ParseQuery.getQuery("ShoppingItems");
query.whereEqualTo("home", home);
query.orderByDescending("createdAt");
query.findInBackground(new FindCallback<ParseObject>() {
     public void done(List<ParseObject> results, ParseException e) {
          pd.dismiss();
          if (e == null) {
               parseList = results;
               recyclerView.setAdapter(new SimpleStringRecyclerViewAdapter(getActivity(), parseList));
          } else {
               Log.d("LIST ERROR", "Error: " + e.getMessage());
          }
     }
});

来源:https://stackoverflow.com/questions/31037329/parsequeryexception-bad-protocol-android-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!