问题
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