本文整理匯總了Java中com.parse.FindCallback類的典型用法代碼示例。如果您正苦於以下問題:Java FindCallback類的具體用法?Java FindCallback怎麽用?Java FindCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FindCallback類屬於com.parse包,在下文中一共展示了FindCallback類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: localQuery
import com.parse.FindCallback; //導入依賴的package包/類
private void localQuery(){
ParseQuery<Kid> lQuery = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
lQuery.orderByAscending("createdAt");
lQuery.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, ParseException e) {
if (e == null) {
kidArrayList.clear();
kidArrayList.addAll(list);
fillHashMap();
adapter = new AddAttendanceAdapter(AddAttendance.this,kidArrayList,activityMap);
listView.setAdapter(adapter);
listView.invalidate();
}
}
});
}
示例2: localQuery
import com.parse.FindCallback; //導入依賴的package包/類
private void localQuery(){
ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, @Nullable ParseException e) {
if (e == null && list.size()!=0) {
kidArrayList.clear();
kidArrayList.addAll(list);
applyAttendanceToKids();
adapter.notifyDataSetChanged();
listView.invalidate();
}
}
});
}
示例3: serverQuery
import com.parse.FindCallback; //導入依賴的package包/類
private void serverQuery() {
ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class);
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, @Nullable ParseException e) {
if (e == null){
kidArrayList.clear();
kidArrayList.addAll(list);
Kid.pinAllInBackground(kidArrayList);
applyAttendanceToKids();
adapter.notifyDataSetChanged();
listView.invalidate();
}else if(checkConnection()){
toaster("Error getting data from Server\nWorking offline!","l");
}
}
});
}
示例4: getContactInfos
import com.parse.FindCallback; //導入依賴的package包/類
public void getContactInfos(List<String> usernames, final EMValueCallBack<List<EaseUser>> callback) {
ParseQuery<ParseObject> pQuery = ParseQuery.getQuery(CONFIG_TABLE_NAME);
pQuery.whereContainedIn(CONFIG_USERNAME, usernames);
pQuery.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> arg0, ParseException arg1) {
if (arg0 != null) {
List<EaseUser> mList = new ArrayList<EaseUser>();
for (ParseObject pObject : arg0) {
EaseUser user = new EaseUser(pObject.getString(CONFIG_USERNAME));
ParseFile parseFile = pObject.getParseFile(CONFIG_AVATAR);
if (parseFile != null) {
user.setAvatar(parseFile.getUrl());
}
user.setNick(pObject.getString(CONFIG_NICK));
EaseCommonUtils.setUserInitialLetter(user);
mList.add(user);
}
callback.onSuccess(mList);
} else {
callback.onError(arg1.getCode(), arg1.getMessage());
}
}
});
}
示例5: loadParseData
import com.parse.FindCallback; //導入依賴的package包/類
private void loadParseData(String Id){
ParseQuery<ParseObject> query = ParseQuery.getQuery(EventTable);
query.whereEqualTo("PhotoAlbumId", Id);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> productParseList, com.parse.ParseException e) {
if (e == null) {
if(productParseList.size() > 0){
eventList.addAll(productParseList);
eventAdapter = new PhotosAdapter(mContext, eventList);
gridView.setAdapter(eventAdapter);
}else{
Toast.makeText(mContext,"Danh sách trống", Toast.LENGTH_SHORT).show();
}
} else {
e.printStackTrace();
LoggerFactory.e("loadParseData", "Error: " + e.getMessage());
}
}
});
}
示例6: loadParseData
import com.parse.FindCallback; //導入依賴的package包/類
private void loadParseData(){
ParseQuery<ParseObject> query = ParseQuery.getQuery(tableName);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> productParseList, com.parse.ParseException e) {
if (e == null) {
if(productParseList.size() > 0){
eventList.addAll(productParseList);
eventAdapter = new VideoAdapter(mContext, eventList);
gridView.setAdapter(eventAdapter);
}else{
Toast.makeText(mContext,"Danh sách trống", Toast.LENGTH_SHORT).show();
}
} else {
e.printStackTrace();
LoggerFactory.e("loadParseData", "Error: " + e.getMessage());
}
}
});
}
示例7: verifyOrganization
import com.parse.FindCallback; //導入依賴的package包/類
private void verifyOrganization(){
final String enteredText = orgName.getText().toString().trim();
final RefreshingDialog rd = new RefreshingDialog(this);
rd.createRefreshingDialog();
ParseQuery<Organization> query = ParseQuery.getQuery(Organization.class);
query.whereEqualTo("name", enteredText);
query.findInBackground(new FindCallback<Organization>() {
@Override
public void done(List<Organization> objects, ParseException e) {
if(objects.isEmpty()){//new group
createGroupAlert(enteredText);
rd.stop();
}else{
joinGroupAlert(objects.get(0));
rd.stop();
}
}
});
}
示例8: loadData
import com.parse.FindCallback; //導入依賴的package包/類
private void loadData() {
ParseQuery<UserInfo> query = ParseQuery.getQuery(UserInfo.class);
query.orderByDescending("score").setLimit(10);
query.findInBackground(new FindCallback<UserInfo>() {
@Override
public void done(List<UserInfo> objects, ParseException e) {
list.addAll(objects);
runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyDataSetChanged();
}
});
}
});
}
示例9: localTeamList
import com.parse.FindCallback; //導入依賴的package包/類
public void localTeamList() {
// Query backend
ParseQuery<ParseObject> query = ParseQuery.getQuery("T" + teamNumber);
query.fromLocalDatastore().findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
// No exception, query successful
if (e == null) {
teams.clear();
Collections.reverse(list);
for (ParseObject object : list) {
if (object.getString("team").equals("")) continue;
Team team = new Team(object.getString("team"), object.getString("region"), object.getString("school"), object.getString("teamName"), object.getObjectId());
teams.add(team);
}
}
adapter.notifyDataSetChanged();
refresh.setRefreshing(false);
}
});
}
示例10: getNodes
import com.parse.FindCallback; //導入依賴的package包/類
public void getNodes(final Callback<List<Node>> cb)
{
if (nodes == null)
{
getNodeRelation()
.getQuery()
.orderByAscending(KEY_ORDER)
.findInBackground(new FindCallback<Node>() {
@Override
public void done(List<Node> objects, ParseException e) {
if (e != null) {
cb.error(new Error(e.getMessage(), e.getCode()));
e.printStackTrace();
} else {
nodes = objects;
cb.done(nodes);
}
}
});
} else {
cb.done(nodes);
}
}
示例11: retrieveChannels
import com.parse.FindCallback; //導入依賴的package包/類
public void retrieveChannels(){
ParseQuery query = new ParseQuery("Channel");
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> channels, ParseException e) {
if (e == null) {
Log.e(LOG_TAG, "Retrieved channels. Size: "+channels.size());
if (channels.size() > 0) {
mRetrievedChannels = (List) channels;
}
} else {
Log.e(LOG_TAG, "Error: " + e.getMessage());
}
}
});
}
示例12: addBullshITBank
import com.parse.FindCallback; //導入依賴的package包/類
public void addBullshITBank(final String NewNumber){
if(NewNumber.length()<6){
Toast.makeText(mContext,
getResources().getString(R.string.too_short),
Toast.LENGTH_LONG).show();
}else{
ParseQuery<ParseObject> query = ParseQuery.getQuery("BullshITBankDB");
query.whereStartsWith("phone", NewNumber);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> parseObjects, ParseException e) {
if (parseObjects.size() > 0) {
Toast.makeText(mContext,
getResources().getString(R.string.duplicate),
Toast.LENGTH_LONG).show();
} else {
FragmentManager fragmentManager = getSupportFragmentManager();
DialogFragment ConfirmDialog = AddNewConfirmDialog.newInstance(NewNumber,GUID);
ConfirmDialog.show(fragmentManager,"confirmdialog");
}
}
});
}
}
示例13: loadMoreData
import com.parse.FindCallback; //導入依賴的package包/類
public void loadMoreData(Integer currentCount){
if(!isUpdating){
notifyUpdateStart();
ParseQuery<SnackEntry> query = ParseQuery.getQuery(SnackEntry.class);
query.orderByDescending("createdAt");
query.whereEqualTo("owner", targetUser);
query.setLimit(10);
query.setSkip(currentCount);
query.findInBackground(new FindCallback<SnackEntry>() {
@Override
public void done(List<SnackEntry> moreSnacks, ParseException e) {
if (e == null) {
snacks.addAll(moreSnacks);
}
notifyUpdateComplete(e);
}
});
}
}
示例14: saveUserLiked
import com.parse.FindCallback; //導入依賴的package包/類
public static void saveUserLiked(final String userId) {
ParseQuery<ParseObject> query = new ParseQuery<>(TABLE_NAME);
query.whereEqualTo(COLUMN_TO_USER, ParseUser.getCurrentUser().getObjectId());
query.whereEqualTo(COLUMN_BY_USER, userId);
query.whereEqualTo(COLUMN_TYPE, TYPE_LIKED);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
ParseObject action = null;
if(e == null && list.size() > 0) {
// we have a match and want to match users together
ParseObject otherAction = list.get(0);
otherAction.put(COLUMN_TYPE, TYPE_MATCHED);
otherAction.saveInBackground();
action = createAction(userId, TYPE_MATCHED);
} else {
action = createAction(userId, TYPE_LIKED);
}
action.saveInBackground();
}
});
}
示例15: getMatches
import com.parse.FindCallback; //導入依賴的package包/類
public static void getMatches(final ActionDataCallbacks callbacks) {
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>(TABLE_NAME);
query.whereEqualTo(COLUMN_BY_USER, ParseUser.getCurrentUser().getObjectId());
query.whereEqualTo(COLUMN_TYPE, TYPE_MATCHED);
query.orderByDescending(COLUMN_UPDATED_AT);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
if(e == null) {
List<String> ids = new ArrayList<String>();
for(ParseObject object : list) {
ids.add(object.getString(COLUMN_TO_USER));
}
if(callbacks != null) {
callbacks.onFetchedMatches(ids);
}
}
}
});
}