本文整理汇总了Java中com.avos.avoscloud.FindCallback类的典型用法代码示例。如果您正苦于以下问题:Java FindCallback类的具体用法?Java FindCallback怎么用?Java FindCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FindCallback类属于com.avos.avoscloud包,在下文中一共展示了FindCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findSendRequests
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
public void findSendRequests(FindCallback findCallback,boolean orderAsc,Map<String,Object> conditions){
AVUser user = HiTalkHelper.getInstance().getCurrentUser();
AVQuery<AddRequest> q = AVObject.getQuery(AddRequest.class);
q.whereEqualTo(AddRequest.FROM_USER, user);
if (conditions != null) {
for (Map.Entry<String,Object> entry : conditions.entrySet()){
q.whereEqualTo(entry.getKey(),entry.getValue());
}
}
if (orderAsc) {
q.orderByAscending(AVObject.CREATED_AT);
} else {
q.orderByDescending(AVObject.CREATED_AT);
}
q.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
q.findInBackground(findCallback);
}
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:18,代码来源:FriendsManager.java
示例2: queryAllSchoolMatesWithState
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
public Task<List<SchoolMate>> queryAllSchoolMatesWithState(Map<String,Object> conditions){
return queryAllSchoolMates(conditions).continueWithTask(task -> {
FriendsManager.getInstance().findSendRequests(new FindCallback<AddRequest>() {
@Override
public void done(List<AddRequest> list, AVException e) {
if (list != null){
for (AddRequest addRequest : list) {
if (addRequest.getStatus() == AddRequest.STATUS_DONE){
SchoolmatesCacheHelper.getInstance()
.update(addRequest.getToUser().getObjectId(),SchoolmatesCacheHelper.REQUEST_STATE_SUCCESS);
} else if (addRequest.getStatus() == AddRequest.STATUS_WAIT){
SchoolmatesCacheHelper.getInstance()
.update(addRequest.getToUser().getObjectId(),SchoolmatesCacheHelper.REQUEST_STATE_WATING);
}
}
EaterManager.getInstance().broadcast(new SchoolMateStateParam());
}
}
},true,null);
return task;
});
}
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:23,代码来源:SchoolMatesManager.java
示例3: loadMoreAddRequest
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void loadMoreAddRequest(boolean isRefresh, DoneCallback<AddRequest> doneCallback) {
FriendsManager.getInstance().findAddRequests(isRefresh ? 0 : mLayout.getCurrentSize(), 20, new FindCallback<AddRequest>() {
@Override
public void done(List<AddRequest> list, AVException e) {
final List<AddRequest> filters = new ArrayList<>();
if (list != null) {
FriendsManager.getInstance().markAddRequestsRead(list);
for (AddRequest addRequest : list) {
if (addRequest.getFromUser() != null) {
filters.add(addRequest);
}
}
}
if (doneCallback != null) {
doneCallback.done(filters,e);
}
}
});
}
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:20,代码来源:NewFriendConfirmActivity.java
示例4: runQuerySync
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
public static <T extends AVObject> List<T> runQuerySync(AVQuery<T> avQuery) throws InterruptedException, AVException {
final CountDownLatch lock = new CountDownLatch(1);
final List<T> result = new ArrayList<>();
final AVException[] exceptions = new AVException[1];
avQuery.findInBackground(new FindCallback<T>() {
@Override
public void done(List<T> list, AVException e) {
if (list != null) {
result.addAll(list);
}else {
exceptions[0] = e;
}
lock.countDown();
}
});
lock.await();
if (exceptions[0] != null){
throw exceptions[0];
}
return result;
}
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:22,代码来源:AvQueryHelper.java
示例5: LoadingData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void LoadingData() {
FindCallback<AVObject> findCallback = new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avObjects, AVException e) {
if (e == null) {
for (AVObject avo : avObjects) {
mDoingListData.add(new DoingListData(avo.getObjectId(),
avo.getString("GroupName")));
}
mHandler.obtainMessage(1).sendToTarget();
adapter.notifyDataSetChanged();
} else {
ERROR();
}
}
};
AVService.findDoingListGroup(findCallback);
}
开发者ID:yoxin,项目名称:pet,代码行数:19,代码来源:DoingListFragment.java
示例6: SetChildrenList
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void SetChildrenList(final String groupObjectId) {
FindCallback<AVObject> findCallback=new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avObjects, AVException e) {
if (e == null) {
ArrayList<DoingListData> childrenList = new ArrayList<DoingListData>();
for (AVObject avo : avObjects) {
childrenList.add(new DoingListData(avo.getObjectId(),
avo.getString("ChildName")));
}
for (DoingListData dld : mDoingListData) {
if (dld.objectId.equals(groupObjectId)) {
dld.doingListData = childrenList;
}
}
adapter.setGroups(mDoingListData);
expandableListView.setVisibility(View.VISIBLE);
messageText.setVisibility(View.INVISIBLE);
adapter.notifyDataSetChanged();
} else {
ERROR();
}
}
};
AVService.findChildrenList(groupObjectId, findCallback);
}
开发者ID:yoxin,项目名称:pet,代码行数:27,代码来源:DoingListFragment.java
示例7: onCreate
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_app);
//this.getActionBar().setDisplayHomeAsUpEnabled(true);
submitButton = (Button) findViewById(R.id.button_about_app_submit_user_input);
submitEditText = (EditText) findViewById(R.id.editText_about_app_user_input);
mUserResponseListView = (ListView) findViewById(R.id.listView_user_back);
submitButton.setOnClickListener(buttonListener);
FindCallback<AVObject> findCallback=new FindCallback<AVObject>() {
public void done(List<AVObject> avObjects, AVException e) {
if (e == null) {
Message msg = new Message();
msg.what = 3;
msg.obj = avObjects;
mHandler.sendMessage(msg);
} else {
showError(activity.getString(R.string.network_error));
}
}
};
AVQuery<AVObject> query = new AVQuery<AVObject>("SuggestionByUser");
query.whereEqualTo("UserObjectId", getUserId());
query.findInBackground(findCallback);
}
开发者ID:yoxin,项目名称:pet,代码行数:27,代码来源:AboutAppActivity.java
示例8: getNewWords
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
/**
* 获取最新词条
*/
private void getNewWords(){
newWords = new ArrayList<>();
AVQuery<AVObject> query=new AVQuery<>("word");
query.setLimit(21);
query.orderByDescending("updatedAt");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (e == null) {
HashSet<String> set=new HashSet<>();//去重
for (AVObject item : list) {
if(!set.contains(item.getString("name"))){
newWords.add(item);
set.add(item.getString("name"));
}
}
newWordAdapter.notifyDataSetChanged();
refreshLayout.setRefreshing(false);
} else {
Log.e("get new words error",e.toString());
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:28,代码来源:WordFragment.java
示例9: getData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
/**
* 获取音/视频资源
*/
private void getData(){
AVQuery<AVObject> query=new AVQuery<>("jxh");
// query.whereEqualTo("isVoice",false);
query.setLimit(1000);
query.orderByDescending("viewcount");
query.include("cover");
query.whereExists("cover");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
mList= (LinkedList<AVObject>) list;
if(adapter!=null)
adapter.notifyDataSetChanged();
}else {
Log.e("getVoice",e.toString());
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:24,代码来源:JxhFragment.java
示例10: onCreate
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_jxh);
AVQuery<AVObject> query=new AVQuery<>("jxh");
query.setLimit(1000);
// query.whereDoesNotExist("coverPic");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
for(AVObject item:list){
attachCover(item);
// attachVoice(item);
// item.put("isVoice", isVoice(item));
item.saveInBackground();
}
Log.e("list size",list.size()+"");
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:25,代码来源:JXH.java
示例11: uploadStoryFile
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
/**
* 为story添加file
*/
private void uploadStoryFile(){
AVQuery<AVObject> query=new AVQuery<>("story");
query.whereExists("url");
query.whereDoesNotExist("voiceFile");
query.setLimit(1000);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (e == null) {
for (AVObject item : list) {
String url = item.getString("url");
try {
AVFile avFile = AVFile.withAbsoluteLocalPath(item.getString("content") + ".mp3", "sdcard/storyFile/" + url + ".mp3");
item.put("voiceFile", avFile);
item.saveInBackground();
} catch (IOException e1) {
Log.e("upload file error", e1.toString());
}
}
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:27,代码来源:MyActivity.java
示例12: addTimeLong
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
/**
* 为story添加timelong
*/
private void addTimeLong(){
AVQuery<AVObject> query=new AVQuery<>("story");
query.setLimit(1000);
query.whereExists("voiceFile");
query.whereExists("url");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (e == null) {
for (AVObject item : list) {
int timeLong = getTimeLong(item.getString("url"));
item.put("timelong", timeLong);
item.saveInBackground();
}
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:22,代码来源:MyActivity.java
示例13: getComments
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void getComments(){
if(comments==null){
comments = new ArrayList<>();
}else {
comments.clear();
}
AVQuery<AVObject> query=new AVQuery<>("storycomment");
query.whereEqualTo("story",story);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
for(AVObject item:list){
comments.add(item);
adapter.notifyDataSetChanged();
}
} else {
Log.e("get story comm err",e.toString());
}
}
});
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:23,代码来源:StoryActivity.java
示例14: onCreate
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AVQuery<AVObject> query=new AVQuery<>("Other");
query.whereEqualTo("name", "UpdateActivity跳转至的Url");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
if (list.size()>0){
String url=list.get(0).getString("url");
Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
finish();
}
}
}
});
//V1.0&V1.1:
// Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.zhagame.com/fangyan"));
// startActivity(intent);
// finish();
}
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:24,代码来源:UpdateActivity.java
示例15: checkFriendAdded
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void checkFriendAdded(final String friendId) {
AVQuery<AVObject> queryUserId1 = new AVQuery<>(Constants.TABLE_NAME_FRIEND);
queryUserId1.whereStartsWith(Constants.KEY_USER_ID, userId);
AVQuery<AVObject> queryUserId2 = new AVQuery<>(Constants.TABLE_NAME_FRIEND);
queryUserId2.whereEndsWith(Constants.KEY_USER_ID, userId);
AVQuery<AVObject> queryFriendId1 = new AVQuery<>(Constants.TABLE_NAME_FRIEND);
queryFriendId1.whereStartsWith(Constants.KEY_FRIEND_ID, friendId);
AVQuery<AVObject> queryFriendId2 = new AVQuery<>(Constants.TABLE_NAME_FRIEND);
queryFriendId2.whereEndsWith(Constants.KEY_FRIEND_ID, friendId);
AVQuery<AVObject> query = AVQuery.and(Arrays.asList(queryUserId1, queryUserId2, queryFriendId1, queryFriendId2));
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (list.isEmpty()) {
Log.d(TAG, "username is not added!");
addFriend(friendId);
} else {
Log.e(TAG, "username is already added!");
ToastUtil.showToastShort(FriendActivity.this, "username is already added!");
}
}
});
}
开发者ID:quekx,项目名称:MyShare,代码行数:26,代码来源:FriendActivity.java
示例16: loadData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void loadData(boolean isRefresh) {
if (isRefresh) {
AVUser user = AVUser.getCurrentUser();
AVRelation<AVObject> relation = user.getRelation("follow");
relation.getQuery().findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mRefreshLayout.setRefreshing(false);
if (e == null) {
if (list.isEmpty()) {
} else {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
}
} else {
e.printStackTrace();
}
}
});
}
}
开发者ID:AndroidCreativeDesign,项目名称:AndroidSharingPlatform,代码行数:24,代码来源:UserFollowFragment.java
示例17: refreshData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void refreshData() {
AVUser user = AVUser.getCurrentUser();
AVQuery<AVObject> query = new AVQuery<>("user_join");
query.setLimit(1);
query.whereEqualTo("user", user);
query.include("idea");
query.include("idea.user");
query.orderByDescending("createAt");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.clear();
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
} else {
e.printStackTrace();
}
}
});
}
开发者ID:AndroidCreativeDesign,项目名称:AndroidSharingPlatform,代码行数:26,代码来源:UserJoinListFragment.java
示例18: loadMoreData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void loadMoreData() {
AVUser user = AVUser.getCurrentUser();
AVQuery<AVObject> query = new AVQuery<>("user_join");
query.setLimit(1);
query.whereEqualTo("user", user);
query.include("idea");
query.include("idea.user");
query.orderByDescending("createAt");
query.whereLessThan("ideaId", mOffset);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
} else {
e.printStackTrace();
}
}
});
}
开发者ID:AndroidCreativeDesign,项目名称:AndroidSharingPlatform,代码行数:26,代码来源:UserJoinListFragment.java
示例19: refreshData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void refreshData() {
AVQuery<AVObject> query = new AVQuery<>("idea");
query.whereEqualTo("user", AVUser.getCurrentUser());
query.orderByDescending("createdAt");
query.setLimit(1);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
Log.i("list.size()", list.size() + "");
if (!list.isEmpty()) {
mData.clear();
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = mData.get(mData.size() - 1).getInt("ideaId");
}
} else {
e.printStackTrace();
}
}
});
}
开发者ID:AndroidCreativeDesign,项目名称:AndroidSharingPlatform,代码行数:25,代码来源:UserPublishListFragment.java
示例20: loadMoreData
import com.avos.avoscloud.FindCallback; //导入依赖的package包/类
private void loadMoreData() {
AVQuery<AVObject> query = new AVQuery<>("idea");
query.setLimit(1);
query.whereEqualTo("user", AVUser.getCurrentUser());
query.orderByDescending("createdAt");
query.whereLessThan("ideaId", mOffset);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
}else {
e.printStackTrace();
}
}
});
}
开发者ID:AndroidCreativeDesign,项目名称:AndroidSharingPlatform,代码行数:25,代码来源:UserPublishListFragment.java
注:本文中的com.avos.avoscloud.FindCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论