Start a new topic

Getting exception while fetching 'progressCollection'

Hi,

I have one 'progressCollection' in which i have following column

group_id,

challengid,

progress,

date,

timestamp,

overallprogress,



I am trying to fetch all data of 'progressCollection' using my group_id, Si i am passing group id but i am getting null pointer Exception.



`Query myQuery = mKinveyClient.query();

myQuery.equals("group_id",groupId);

AsyncAppData myEvents = mKinveyClient.appData("ProgressCollection", ProgressEntity.class);

myEvents.get(myQuery, new KinveyListCallback() {

@Override

public void onSuccess(ProgressEntity[] results) {

Log.v("WILL", "progress by specific group "+ results.length + " events and givenName = "+results);

groupsInMyChallenge = results.length;

List myList = Arrays.asList(results);



}

@Override

public void onFailure(Throwable error) {

Log.e("TEST", "failed to fetchByFilterCriteria", error);

}

});`



I also create GenericJSON class.



`public class ProgressEntity extends GenericJson {

@Key("_id")

private String id;

@Key

private int group_id;

@Key

private int challangeid;

@Key

private String date;

@Key

private boolean overallprogress;

@Key

private long timestamp;

@Key

private String progress;

@Key("_kmd")

private KinveyMetaData meta; // Kinvey metadata, OPTIONAL

@Key("_acl")

private KinveyMetaData.AccessControlList acl; //Kinvey access control, OPTIONAL

public ProgressEntity(){} //GenericJson classes must have a public empty constructor

}`





Here is Exception which i really don't know why i am getting..



`05-11 15:48:59.291: E/AndroidRuntime(29064): FATAL EXCEPTION: main

05-11 15:48:59.291: E/AndroidRuntime(29064): java.lang.NullPointerException

05-11 15:48:59.291: E/AndroidRuntime(29064): at com.mindscrub.willpowerdrive.DashBoardActivity$11.onSuccess(DashBoardActivity.java:485)

05-11 15:48:59.291: E/AndroidRuntime(29064): at com.mindscrub.willpowerdrive.DashBoardActivity$11.onSuccess(DashBoardActivity.java:1)

05-11 15:48:59.291: E/AndroidRuntime(29064): at com.kinvey.android.AsyncClientRequest.onPostExecute(AsyncClientRequest.java:91)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.os.AsyncTask.finish(AsyncTask.java:631)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.os.AsyncTask.access$600(AsyncTask.java:177)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.os.Handler.dispatchMessage(Handler.java:99)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.os.Looper.loop(Looper.java:153)

05-11 15:48:59.291: E/AndroidRuntime(29064): at android.app.ActivityThread.main(ActivityThread.java:5297)

05-11 15:48:59.291: E/AndroidRuntime(29064): at java.lang.reflect.Method.invokeNative(Native Method)

05-11 15:48:59.291: E/AndroidRuntime(29064): at java.lang.reflect.Method.invoke(Method.java:511)

05-11 15:48:59.291: E/AndroidRuntime(29064): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)

05-11 15:48:59.291: E/AndroidRuntime(29064): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)

05-11 15:48:59.291: E/AndroidRuntime(29064): at dalvik.system.NativeStart.main(Native Method)`



I have data in my Progress collection. Please give me nay hint or reference so i can understand where i am wrong.



My all other fetching and saving code working fine except this one.



Thanks in Advance.
1 Comment

Hey--



at a glance that code all looks correct, can you enable debug logging by taking a look at this guide: http://devcenter.kinvey.com/android/guides/troubleshooting



That will dump all http requests and responses to the logs, can you post those here as they might give some insight into what is going on?
Login or Signup to post a comment