本文整理汇总了Java中cn.bmob.v3.listener.CountListener类的典型用法代码示例。如果您正苦于以下问题:Java CountListener类的具体用法?Java CountListener怎么用?Java CountListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CountListener类属于cn.bmob.v3.listener包,在下文中一共展示了CountListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryFanNum
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
/**
* 查询粉丝数目
*/
private void queryFanNum() {
BmobQuery<User> query = new BmobQuery<>();
query.include("focus");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", dynamicAuthor.getObjectId());
query.addWhereMatchesQuery("focus", "_User", innerQuery);
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
tvFan.setText(integer.toString());
} else {
showToast("查询粉丝数目失败" + e.getErrorCode() + e.getMessage());
}
}
});
}
示例2: queryFanNum
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
/**
* 查询粉丝数目
*/
private void queryFanNum(User user) {
BmobQuery<User> query = new BmobQuery<>();
query.include("focus");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
query.addWhereMatchesQuery("focus", "_User", innerQuery);
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
tvFan.setText(integer.toString());
} else {
showToast("查询粉丝数目失败" + e.getErrorCode() + e.getMessage());
}
}
});
}
示例3: requestFansNum
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
/**
* 请求获取用户粉丝数量
*/
public void requestFansNum(User user, final RequestListener<String> listener) {
BmobQuery<User> query = new BmobQuery<User>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
// query.addQueryKeys("followPerson");
query.addWhereMatchesQuery("followPerson", "_User", innerQuery);
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
listener.success(Integer.toString(integer));
} else {
listener.success("0");
}
}
});
}
示例4: requestCollectNum
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
/**
* 请求获取用户喜欢的文章数量
*/
public void requestCollectNum(User user, final RequestListener<String> listener) {
BmobQuery<Post> query = new BmobQuery<>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
// query.addQueryKeys("followPerson");
query.addWhereMatchesQuery("likes", "_User", innerQuery);
query.count(Post.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
listener.success(Integer.toString(integer));
} else {
listener.success("0");
}
}
});
}
示例5: requestFocusNum
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
/**
* 请求获取用户关注其他用户数量
*/
public void requestFocusNum(User user, final RequestListener<String> listener) {
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("followPerson", new BmobPointer(user));
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
listener.success(Integer.toString(integer));
} else {
listener.success("0");
}
}
});
}
示例6: requestMyCouponsData
import cn.bmob.v3.listener.CountListener; //导入依赖的package包/类
private void requestMyCouponsData() {
BmobQuery<MyCouponsData> count = new BmobQuery<MyCouponsData>();
count.addWhereEqualTo("mMyUser", myUser);
count.count(MyCouponsData.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null && integer != 0) {
mTvMyYouhui.setRigtTvText(integer + "张");
} else {
mTvMyYouhui.setRigtTvText("");
Log.d(TAG, "done:MyCouponsData " + e);
}
}
});
}