cn.bmob.v3.BmobQuery Java Examples

The following examples show how to use cn.bmob.v3.BmobQuery. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: lua_web.java    From stynico with MIT License 6 votes vote down vote up
/**
    * 初始化网路数据:
    */
   private void initWebView()
   {
BmobQuery<o> query = new BmobQuery<o>();
query.getObject(lua_web.this, "957aaf7e08", new GetListener<o>() {

	@Override
	public void onSuccess(o object)
	{

	    wv_web.loadUrl(object.getContent());
	    wv_web.setWebViewClient(new MyWebViewClient());
	    wv_web.setDownloadListener(new MyDownLoadListener());
	}
	
	@Override
	public void onFailure(int code, String msg)
	{
	}
    });}
 
Example #2
Source File: PreferenceUtil.java    From ZfsoftCampusAssit with Apache License 2.0 6 votes vote down vote up
public static Setting getSettingConfig() {
    Setting setting = get(Setting.class);
    if (setting == null && getLoginUser() != null) {
        BmobQuery<Setting> query = new BmobQuery<>();
        query.addWhereEqualTo("userid", getLoginUser().getUsername());
        query.findObjects(mContext, new FindListener<Setting>() {
            @Override
            public void onSuccess(List<Setting> list) {
                if (!list.isEmpty()) {
                    updateSettingConfig(list.get(0));
                } else {
                    Log.e(tag, "setting config by userid " +
                            getLoginUser().getUsername() + " query results is empty");
                }
            }

            @Override
            public void onError(int i, String s) {
                Log.e(tag, "setting config query results error " + s);
            }
        });
    }
    return setting;
}
 
Example #3
Source File: OrderActivity.java    From BitkyShop with MIT License 6 votes vote down vote up
private void queryDefaultAddressFromBmob() {
  BmobQuery<ReceiveAddress> bmobQuery = new BmobQuery<>();
  bmobQuery.addWhereEqualTo("userObjectId", order.getUserObjectId());
  bmobQuery.addWhereEqualTo("isDefault", true);
  bmobQuery.setLimit(50);
  bmobQuery.findObjects(new FindListener<ReceiveAddress>() {

    @Override public void done(List<ReceiveAddress> list, BmobException e) {
      if (e != null) {
        toastUtil.show(e.getMessage());
        return;
      }
      if (list.size() > 0) {
        receiveAddress = list.get(0);
        name.setText(receiveAddress.getName());
        phone.setText(receiveAddress.getPhone());
        address.setText(receiveAddress.getAddress());
      }
    }
  });
}
 
Example #4
Source File: MyCouponsActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void requesData() {
    mDialog.show();
    if (mQuery == null) {
        mQuery = new BmobQuery<>("MyCouponsData");
        mQuery.setLimit(10);
        mQuery.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId());
        mQuery.order("-updatedAt");
    }
    mQuery.findObjects(new FindListener<MyCouponsData>() {
        @Override
        public void done(List<MyCouponsData> list, BmobException e) {
            if (e == null) {
                mData = list;
                showCoupons();
            } else {
                ToastUtils.show(MyCouponsActivity.this, "暂时没有优惠信息");
                Logger.d(e);
            }
            dismissMyDialog();
        }
    });
}
 
Example #5
Source File: SubscribedChannelFragment.java    From VSigner with GNU General Public License v2.0 6 votes vote down vote up
public void refreshData() {
	BmobQuery<ChannelSubscriber> channelSubscriberQuery = new BmobQuery<ChannelSubscriber>();
	channelSubscriberQuery.addWhereEqualTo(ChannelSubscriber.SUBSCRIBER_KEY, mCurrentUser.getObjectId());
	channelSubscriberQuery.include(String.format("%1$s,%2$s", 
			ChannelSubscriber.CHANNEL_KEY, 
			ChannelSubscriber.CHANNEL_KEY + "." + Channel.MANAGER_KEY));
	channelSubscriberQuery.setLimit(Constants.QUERY_MAX_NUMBER);
	channelSubscriberQuery.order("-" + Constants.UPDATED_AT_KEY);
	channelSubscriberQuery.findObjects(mContext, new FindListener<ChannelSubscriber>() {
		@Override
		public void onSuccess(List<ChannelSubscriber> channelSubscribers) {
			mSubscribedChannelAdapter.clear();
			for (ChannelSubscriber channelSubscriber : channelSubscribers) {
				mSubscribedChannelAdapter.add(channelSubscriber.getChannel());
			}
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
		}
		
		@Override
		public void onError(int arg0, String msg) {
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL);
		}
	});
}
 
Example #6
Source File: ShowSignerActivity.java    From VSigner with GNU General Public License v2.0 6 votes vote down vote up
public void refreshData() {
	BmobQuery<ChannelSigner> channelQuery = new BmobQuery<ChannelSigner>();
	channelQuery.addWhereEqualTo(ChannelSigner.CHANNEL_KEY, mChannel.getObjectId());
	channelQuery.addWhereGreaterThanOrEqualTo(ChannelSigner.SIGN_DATE_KEY, mChannel.getStartSignDate());
	channelQuery.include(String.format("%1$s,%2$s", 
			ChannelSigner.SIGNER_KEY,
			ChannelSigner.CHANNEL_KEY));
	channelQuery.setLimit(Constants.QUERY_MAX_NUMBER);
	channelQuery.order(ChannelSigner.SIGNER_KEY);
	channelQuery.findObjects(mContext, new FindListener<ChannelSigner>() {
		@Override
		public void onSuccess(List<ChannelSigner> channelSigners) {
			mChannelSignerAdapter.clear();
			mChannelSignerAdapter.addAll(channelSigners);
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
		}
		
		@Override
		public void onError(int arg0, String msg) {
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL);
		}
	});
}
 
Example #7
Source File: Compat3.java    From styT with Apache License 2.0 6 votes vote down vote up
/**
 * 查询微博
 */
private void findWeibos() {
    BmobQuery<Post_> query = new BmobQuery<Post_>();
    query.order("-updatedAt");
    query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法
    query.findObjects(new FindListener<Post_>() {
        @Override
        public void done(List<Post_> object, BmobException e) {
            if (e == null) {
                weibos = object;
                adapter.notifyDataSetChanged();
            } else {
                //loge(e);
            }
        }

    });

}
 
Example #8
Source File: LastTenTripHistoryActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void requestData() {
    mDialog.show();
    if (mQuery == null) {
        mQuery = new BmobQuery<>("MyTripsData");
        mQuery.setLimit(10);
        mQuery.addWhereEqualTo("mMyUser", MyApplication.
                getInstance().getUser().getObjectId());
        mQuery.order("-updatedAt");
    }
    mQuery.findObjects(new FindListener<MyTripsData>() {
        @Override
        public void done(List<MyTripsData> list, BmobException e) {
            if (e == null) {
                mData = list;
                showMyTrips();
            } else {
                ToastUtils.show(LastTenTripHistoryActivity.this, "暂时没有骑行记录");
                Logger.d(e);
            }
            dismissMyDialog();
        }
    });
}
 
Example #9
Source File: RechargeHistoryActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void requestData() {
    BmobQuery<RechargeHistoryData> query = new BmobQuery<>("RechargeHistoryData");
    query.order("-updatedAt");
    query.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId());
    //query.setLimit(4);//最新四条活动信息
    if (isFirstin) {
        mDialog.show();
        isFirstin = false;
    }
    query.findObjects(new FindListener<RechargeHistoryData>() {
        @Override
        public void done(List<RechargeHistoryData> list, BmobException e) {
            if (e == null) {
                mDatas = list;
                showHistory();
            } else {
                ToastUtils.show(RechargeHistoryActivity.this, "暂时没有消息");
                Logger.d(e);
            }
            dismissMyDialog();
        }
    });

}
 
Example #10
Source File: LoginActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void RegOK() {
    mDialog.show();
    mPhone = mEtPhone.getText().toString().trim().replace("\\s*", "");// TODO: 2017/6/21  测试后删除
    BmobQuery<MyUser> query = new BmobQuery<MyUser>();
    query.addWhereEqualTo("username", mPhone);
    query.setLimit(1);
    query.findObjects(new FindListener<MyUser>() {
        @Override
        public void done(List<MyUser> list, BmobException e) {
            if (e == null) {
                if (list.size() > 0 && list != null) {
                    Log.d(TAG, "cheackUser: ok");
                    toLogin();
                } else {
                    Log.d(TAG, "cheackUser: notRegister");
                    toRegister();
                }
            } else {
                Log.d(TAG, "done: " + e);
                DismissMyDialog();
            }
        }
    });
}
 
Example #11
Source File: MyTripsActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void requestData() {
    mDialog.show();
    if (mQuery == null) {
        mQuery = new BmobQuery<>("MyTripsData");
        mQuery.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId());
        mQuery.order("-updatedAt");
    }
    mQuery.findObjects(new FindListener<MyTripsData>() {
        @Override
        public void done(List<MyTripsData> list, BmobException e) {
            if (e == null) {
                mData = list;
                showMyTrips();
            } else {
                ToastUtils.show(MyTripsActivity.this, "暂时没有骑行记录");
                Logger.d(e);
            }
            dismissMyDialog();
        }
    });
}
 
Example #12
Source File: Update.java    From styT with Apache License 2.0 6 votes vote down vote up
private void xft() {

        BmobQuery<i_a> query = new BmobQuery<>();
        query.getObject("03bf357e85", new QueryListener<i_a>() {

            @Override
            public void done(i_a movie, BmobException e) {
                if (e == null) {
                    String s = movie.getContent();
                    String sr = nico.styTool.Constant.a_mi + "\n" + nico.styTool.Constant.a_miui;
                    if (s.equals(sr)) {

                    } else {
                        nico.styTool.ToastUtil.show(Update.this, "版本不一致,请更新", Toast.LENGTH_SHORT);
                        finish();
                    }
                } else {

                }
            }
        });
    }
 
Example #13
Source File: PublishActivity.java    From styT with Apache License 2.0 6 votes vote down vote up
private void xft() {

        BmobQuery<i_a> query = new BmobQuery<>();
        query.getObject("03bf357e85", new QueryListener<i_a>() {

            @Override
            public void done(i_a movie, BmobException e) {
                if (e == null) {
                    String s = movie.getContent();
                    String sr = nico.styTool.Constant.a_mi + "\n" + nico.styTool.Constant.a_miui;
                    if (s.equals(sr)) {

                    } else {
                        nico.styTool.ToastUtil.show(PublishActivity.this, "版本不一致,请更新", Toast.LENGTH_SHORT);
                        finish();
                    }
                } else {
                    finish();
                }
            }
        });
    }
 
Example #14
Source File: HelpsCommentActivity.java    From styT with Apache License 2.0 6 votes vote down vote up
/**
 * 使用bmob进行消息推送
 *
 * @param myUser
 */
private void bmobpush(MyUser myUser, String comment) {
    String installationId = helps.getUser().getObjectId();
    BmobPushManager bmobPushManager = new BmobPushManager();
    BmobQuery<MyUserInstallation> query = new BmobQuery<MyUserInstallation>();
    query.addWhereEqualTo("uid", installationId);
    bmobPushManager.setQuery(query);
    bmobPushManager.pushMessage(myUser.getUsername() + "评论了你");

    NotifyMsg notifyMsg = new NotifyMsg();
    notifyMsg.setHelps(helps);
    notifyMsg.setUser(helps.getUser());
    notifyMsg.setAuthor(myUser);
    notifyMsg.setStatus(false);
    notifyMsg.setMessage(comment);
    notifyMsg.save(new SaveListener<String>() {
        @Override
        public void done(String s, BmobException e) {

        }
    });
}
 
Example #15
Source File: CommentListActivity_.java    From styT with Apache License 2.0 6 votes vote down vote up
private void findComments() {
    BmobQuery<Comment_> query = new BmobQuery<Comment_>();
    // pointer类型
    query.addWhereEqualTo("post", new BmobPointer(weibo));
    query.include("user,post.author");
    query.findObjects(new FindListener<Comment_>() {

        @Override
        public void done(List<Comment_> object, BmobException e) {
            if (e == null) {
                comments = object;
                adapter.notifyDataSetChanged();
                et_content.setText("");
            } else {
                //loge(e);
            }
        }

    });

}
 
Example #16
Source File: TestActivity.java    From Mobike with Apache License 2.0 6 votes vote down vote up
private void cheackUser() {
    BmobQuery<MyUser> query = new BmobQuery<MyUser>();
    query.addWhereEqualTo("username", "182****2002");
    query.setLimit(1);
    query.findObjects(new FindListener<MyUser>() {
        @Override
        public void done(List<MyUser> list, BmobException e) {
            if (e == null) {
                if (list.size() > 0 && list != null) {
                    Log.d(TAG, "cheackUser: ok");
                } else {
                    Log.d(TAG, "cheackUser: not");
                }
            } else {
                Log.d(TAG, "done: " + e);
            }
        }
    });
}
 
Example #17
Source File: AttentionModel.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
public Observable<List<MyAttentionEntity>> getMyAttentionList(String userid) {
    return Observable.create((ObservableOnSubscribe<List<MyAttentionEntity>>) emitter -> {

        BmobQuery<MyAttentionEntity> query = new BmobQuery<MyAttentionEntity>();
        query.addWhereEqualTo("userId", userid);
        query.order("-createdAt");
        query.findObjects(new FindListener<MyAttentionEntity>() {
            @Override
            public void done(List<MyAttentionEntity> list, BmobException e) {
                if (list!=null)
                    emitter.onNext(list);
            }
        });
    });
}
 
Example #18
Source File: HistoryModel.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
public Observable<List<VideoDaoEntity>> getListFromNet(int start, String userid) {
    return Observable.create((ObservableOnSubscribe<List<VideoDaoEntity>>) emitter -> {

        BmobQuery<VideoDaoEntity> query = new BmobQuery<VideoDaoEntity>();
        query.addWhereEqualTo("userId", userid);
        query.setLimit(10);
        query.order("-updatedAt");
        query.setSkip(start);
        query.findObjects(new FindListener<VideoDaoEntity>() {
            @Override
            public void done(List<VideoDaoEntity> list, BmobException e) {
                List<VideoDaoEntity> infolist = new ArrayList<VideoDaoEntity>();
                if (!StringUtils.isEmpty(list)) {
                    for (VideoDaoEntity entity1 : list) {
                        entity1.setVideo(mGson.fromJson(entity1.getBody(), VideoListInfo.Video.VideoData.class));
                        infolist.add(entity1);
                    }
                }
                emitter.onNext(infolist);
            }
        });
    });
}
 
Example #19
Source File: OrderActivity.java    From BitkyShop with MIT License 6 votes vote down vote up
/**
 *
 */
private void queryCurrentOrderFromBmob() {
  BmobQuery<Order> bmobQuery = new BmobQuery<>();
  bmobQuery.addWhereEqualTo("objectId", order.getObjectId());
  bmobQuery.findObjects(new FindListener<Order>() {

    @Override public void done(List<Order> list, BmobException e) {
      if (e != null) {
        toastUtil.show(e.getMessage());
        return;
      }
      if (list.size() > 0) {
        order = list.get(0);
        initOrder(order);
      }
    }
  });
}
 
Example #20
Source File: BmobCourseDataSource.java    From ZfsoftCampusAssit with Apache License 2.0 6 votes vote down vote up
@Override
public void getLocalWeekTimetableCourses(int currentWeekNo, final LoadCoursesCallback callback) {
    BmobQuery<Course> weekCourseQuery = new BmobQuery<>();
    weekCourseQuery.addWhereContains(
            CoursePersistenceContract.CourseTimetableEntry.COLUMN_NAME_WEEKS, String.valueOf(currentWeekNo));
    weekCourseQuery.findObjects(mContext, new FindListener<Course>() {
        @Override
        public void onSuccess(List<Course> list) {
            callback.onCoursesLoaded(list);
        }

        @Override
        public void onError(int i, String s) {
            callback.onDataError();
        }
    });
}
 
Example #21
Source File: HomeFragment.java    From BitkyShop with MIT License 6 votes vote down vote up
/**
 * 广告栏Slider数据初始化
 */
private void getBmobSliderData() {
    BmobQuery<Commodity> bmobQuery = new BmobQuery<>();
    bmobQuery.addWhereEqualTo("AD", "true").setLimit(5).findObjects(new FindListener<Commodity>() {
        @Override
        public void done(List<Commodity> list, BmobException e) {
            if (e != null) {
                KLog.d(TAG, "异常内容:" + e.getMessage());
            } else if (list.size() > 0) {
                KLog.d(TAG, "list.size():" + list.size());
                mTextSliderViews = new ArrayList<>();
                for (Commodity commodity : list) {
                    mTextSliderViews.add(
                        buildTextSlider(commodity.getCoverPhotoUrl(), commodity.getName(), 0));
                }
                KLog.d(TAG, "mTextSliderViews.size():" + mTextSliderViews.size());

                if (mSliderLayout != null) initSlider();
            }
        }
    });
}
 
Example #22
Source File: SearchActivity.java    From BitkyShop with MIT License 6 votes vote down vote up
private void searchCommodity() {
  ((InputMethodManager) context.getSystemService(
      Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(searchEdittext.getWindowToken(),
      InputMethodManager.HIDE_NOT_ALWAYS);
  String msg = searchEdittext.getText().toString().trim();
  if (msg.equals("")) {
    toastUtil.show("请输入要搜索的商品");
    return;
  }
  BmobQuery<Commodity> bmobQuery = new BmobQuery<>();
  bmobQuery.addWhereEqualTo("categorySub", msg);
  KLog.d(msg);
  bmobQuery.findObjects(new FindListener<Commodity>() {
    @Override public void done(List<Commodity> list, BmobException e) {
      if (e != null) {
        KLog.d(e.getMessage());
      }
      if (list != null) {
        KLog.d(list.size());
      }
    }
  });
}
 
Example #23
Source File: ReviewFragment.java    From AndroidReview with GNU General Public License v3.0 6 votes vote down vote up
/**
 * “单元”列表下拉刷新具体实现
 */
private void putToRefreshByUnit() {
    //初始化Bmob查询类
    BmobQuery<Unit> query = new BmobQuery<>();
    //执行查询,查询单元表 取出所有单元
    query.findObjects(getContext(), new FindListener<Unit>() {
        @Override
        public void onSuccess(final List<Unit> unitList) {
            //根据查询的所有单元,请求所有的知识点数据
            requestPointByUnits(unitList);
        }
        @Override
        public void onError(int i, String s) {
            toastError(mLoadingLayout, getContext());
        }
    });

}
 
Example #24
Source File: CommentListActivity.java    From stynico with MIT License 6 votes vote down vote up
private void findComments()
{
	BmobQuery<Comment_> query = new BmobQuery<Comment_>();
	// pointer类型
	query.addWhereEqualTo("post", new BmobPointer(weibo));		
	query.include("user,post.author");
	query.findObjects(getActivity(), new FindListener<Comment_>() {

			@Override
			public void onSuccess(List<Comment_> object)
			{
				// TODO Auto-generated method stub
				comments = object;
				adapter.notifyDataSetChanged();
				et_content.setText("");
			}

			@Override
			public void onError(int code, String msg)
			{
				// TODO Auto-generated method stub
				//toast("查询失败:"+msg);
			}
		});}
 
Example #25
Source File: WeiboListActivity.java    From stynico with MIT License 6 votes vote down vote up
private void findWeibos_()
{
	nico.styTool.MyUser user = BmobUser.getCurrentUser(this, nico.styTool.MyUser.class);
	BmobQuery<Post_> query = new BmobQuery<Post_>();
	query.addWhereEqualTo("author", user);	// 查询当前用户的所有微博
	query.order("-updatedAt");
	query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法
	query.findObjects(this, new FindListener<Post_>() {
			@Override
			public void onSuccess(List<Post_> object)
			{
				// TODO Auto-generated method stub
				weibos = object;
				adapter.notifyDataSetChanged();
				//et_content.setText("");
			}

			@Override
			public void onError(int code, String msg)
			{
				// TODO Auto-generated method stub
				//toast("查询失败:"+msg);
			}
		});
}
 
Example #26
Source File: ShareInfoPresenter.java    From NewFastFrame with Apache License 2.0 6 votes vote down vote up
public void getFirstPostNotifyBean() {
    BmobQuery<PostNotifyBean> bmobQuery = new BmobQuery<>();
    bmobQuery.addWhereEqualTo("toUser", new BmobPointer(UserManager.getInstance().getCurrentUser()));
    bmobQuery.addWhereEqualTo("readStatus", ConstantUtil.READ_STATUS_READED);
    bmobQuery.order("-createdAt");
    bmobQuery.setLimit(1);
    bmobQuery.include("relatedUser");
    addSubscription(bmobQuery.findObjects(new FindListener<PostNotifyBean>() {
        @Override
        public void done(List<PostNotifyBean> list, BmobException e) {
            if (e == null && list != null && list.size() > 0) {
                RxBusManager.getInstance().post(new UnReadPostNotifyEvent(list.get(0)));
            }
        }
    }));
}
 
Example #27
Source File: LoginF.java    From stynico with MIT License 6 votes vote down vote up
private void findWeibos()
  {
//MyUser user = BmobUser.getCurrentUser(LoginF.this, MyUser.class);
BmobQuery<Login> query = new BmobQuery<Login>();
//query.addWhereEqualTo("author", user);	// 查询当前用户的所有微博
query.order("-updatedAt");
query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法
query.findObjects(LoginF.this, new FindListener<Login>() {
		@Override
		public void onSuccess(List<Login> object)
		{
			// TODO Auto-generated method stub
			weibos = object;
			adapter.notifyDataSetChanged();
			//  mProgressDialog.dismiss();
		}

		@Override
		public void onError(int code, String msg)
		{
			// TODO Auto-generated method stub
			//   toast("查询失败:" + msg);
		}
	});
//mProgressDialog = ProgressDialog.show(getActivity(), null, getResources().getString(R.string.del_));
  }
 
Example #28
Source File: MainActivity.java    From WliveTV with Apache License 2.0 6 votes vote down vote up
public void queryData()
{
    BmobQuery<LiveBean> bmobQuery = new BmobQuery<LiveBean>();
    bmobQuery.findObjects(this, new FindListener<LiveBean>() {
        @Override
        public void onSuccess(List<LiveBean> list) {
            System.out.println(list.size());
            adapter.updateDatas(list);
        }

        @Override
        public void onError(int i, String s) {

        }
    });
}
 
Example #29
Source File: OwnChannelFragment.java    From VSigner with GNU General Public License v2.0 6 votes vote down vote up
public void refreshData() {
	BmobQuery<Channel> channelQuery = new BmobQuery<Channel>();
	channelQuery.addWhereEqualTo(Channel.MANAGER_KEY, mCurrentUser.getObjectId());
	channelQuery.include(Channel.MANAGER_KEY);
	channelQuery.setLimit(Constants.QUERY_MAX_NUMBER);
	channelQuery.order("-" + Channel.IS_ACTIVE_KEY + ",-" + Constants.UPDATED_AT_KEY);
	channelQuery.findObjects(mContext, new FindListener<Channel>() {
		@Override
		public void onSuccess(List<Channel> channels) {
			mOwnChannelAdapter.clear();
			mOwnChannelAdapter.addAll(channels);
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
		}
		
		@Override
		public void onError(int arg0, String msg) {
			mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL);
		}
	});
}
 
Example #30
Source File: MsgManager.java    From TestChat with Apache License 2.0 5 votes vote down vote up
/**
 * 根据是否是标签和ID值(conversation 或  belongId)和创建时间来查询消息
 *
 * @param isBelongId   是否是标签消息
 * @param id           会话id或者是用户ID
 * @param createTime   创建时间
 * @param findListener 找到消息的回调
 */
private void queryMsg(boolean isBelongId, String id, String createTime, FindListener<ChatMessage> findListener) {
        BmobQuery<ChatMessage> query = new BmobQuery<>();
        if (isBelongId) {
                query.addWhereEqualTo("belongId", id);
        } else {
                query.addWhereEqualTo("conversationId", id);
                query.addWhereNotEqualTo("tag", Constant.TAG_ASK_READ);
        }
        query.addWhereEqualTo("createTime", createTime);
        query.findObjects(CustomApplication.getInstance(), findListener);
}