当前位置: 首页>>代码示例>>Java>>正文


Java CountListener类代码示例

本文整理汇总了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());
            }
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:22,代码来源:PersonPageActivity.java

示例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());
            }
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:22,代码来源:MeFragment.java

示例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");
                }
            }
        });
    }
 
开发者ID:weimin96,项目名称:shareNote,代码行数:21,代码来源:NetRequest.java

示例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");
                }
            }
        });
    }
 
开发者ID:weimin96,项目名称:shareNote,代码行数:21,代码来源:NetRequest.java

示例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");
            }
        }
    });
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:18,代码来源:NetRequest.java

示例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);
            }
        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:16,代码来源:UserActivity.java


注:本文中的cn.bmob.v3.listener.CountListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。