parse-community / ParseUI-Android

ParseUI contains user interface libraries for building apps with the Parse Android SDK.
Other
592 stars 324 forks source link

ParseQueryAdapter #126

Open amebrahimi opened 8 years ago

amebrahimi commented 8 years ago

Hi, i'm new to coding and i'm trying to build an app that contains a parse adapter , but there is no method such as isLocalDatastoreEnabled() in Parse library that you used in you're code can you please help me to understand the code when it uses isLocalDatastoreEnabled().

if (Parse.isLocalDatastoreEnabled() ||
        (query.getCachePolicy() != CachePolicy.CACHE_THEN_NETWORK) ||
        (query.getCachePolicy() == CachePolicy.CACHE_THEN_NETWORK && !firstCallBack.get())) {
      runningQueries.remove(query);
    }

    if ((!Parse.isLocalDatastoreEnabled() &&
        query.getCachePolicy() == CachePolicy.CACHE_ONLY) &&
        (e != null) && e.getCode() == ParseException.CACHE_MISS) {
      // no-op on cache miss
      return;
    }
amebrahimi commented 8 years ago

I have imported your dependencies and that problem is gone , but there is a another problem that when i open the ParseQueryAdapter library there there is one issue ParseObject.getClassName(clazz) is Non-Static method. how can i solve this one.

 public ParseQueryAdapter(Context context, Class<? extends ParseObject> clazz) {
this(context, ParseObject.getClassName(clazz));
}
wangmengyan95 commented 8 years ago

Hi @amebrahimi, not 100% sure what you try to achieve but if you just want the className you can do clazz.getClassName() instead.

grantland commented 8 years ago

These are package private methods which you shouldn't need to call on your own. You should be referencing the code in this repository as a compile library rather than copying the sources into your project.

jbardeleben commented 8 years ago

I had this problem as well and I was using "com.parse:parse-android:1.13.1" but when I went back to "com.parse:parse-android:1.10.0" it worked fine.