android - How to retrieve ParseObject from Parse DataBrowser -
i have code: retrieve courses of student loged name in "namecurrentstudent" , stock courses in arraylist
parsequery<parseobject> query = parsequery.getquery("courses"); query = query.whereequalto("student", namecurrentstudent); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> courselist, parseexception e) { if (e == null) { courses.clear(); (parseobject course : courselist) { courses.add(course.getstring("namecourse")); } } else { log.d("post retrieval", "error: " + e.getmessage()); } } });
but when use debug skipps query.findinbackground(new findcallback() { know's why ?
parsequery<parseobject> queryp = parsequery.getquery("courses"); queryp.whereequalto("student", namestudent); queryp.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> courseslist, parseexception e) { arraylist<string> courses = null; if (e == null) { courses = new arraylist<string>(); (parseobject course : courseslist) { string coursename = course.getstring("coursesnameinparsecolumn"); courses.add(coursename); } } else { log.d("post retrieval", "error: " + e.getmessage()); } populatecourseslist(courses); } });
Comments
Post a Comment