ParseUI-Android icon indicating copy to clipboard operation
ParseUI-Android copied to clipboard

ParseQueryAdapter

Open amebrahimi opened this issue 8 years ago • 4 comments

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 avatar Jan 24 '16 14:01 amebrahimi

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));
}

amebrahimi avatar Jan 25 '16 15:01 amebrahimi

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

wangmengyan95 avatar Jan 25 '16 18:01 wangmengyan95

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.

grantland avatar Jan 25 '16 19:01 grantland

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.

jbardeleben avatar Aug 24 '16 20:08 jbardeleben