本文整理汇总了Java中cn.bmob.v3.datatype.BmobPointer类的典型用法代码示例。如果您正苦于以下问题:Java BmobPointer类的具体用法?Java BmobPointer怎么用?Java BmobPointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BmobPointer类属于cn.bmob.v3.datatype包,在下文中一共展示了BmobPointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findComments
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
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);
}
});}
示例2: queryBlackList
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 查询黑名单用户
*
* @param callback 回调
*/
private void queryBlackList(final FindListener<User> callback) {
BmobQuery<User> query = new BmobQuery<>();
query.order("updateAt");
query.addWhereRelatedTo(COLUMN_NAME_BLACKLIST, new BmobPointer(getCurrentUser()));
query.findObjects(CustomApplication.getInstance(), new FindListener<User>() {
@Override
public void onSuccess(List<User> list) {
callback.onSuccess(list);
}
@Override
public void onError(int i, String s) {
callback.onError(i, s);
}
}
);
}
示例3: getLikesData
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void getLikesData() {
BmobQuery<MyUser> query = new BmobQuery<>();
Post post = new Post();
post.setObjectId(mPost.getObjectId());
query.addWhereRelatedTo("likes", new BmobPointer(post));
query.findObjects(new FindListener<MyUser>() {
@Override
public void done(List<MyUser> list, BmobException e) {
if (e == null) {
if (list.isEmpty()) {
mPostDetailLikesRecycler.setVisibility(View.GONE);
mLikesNo.setVisibility(View.VISIBLE);
mLikesNo.setText(R.string.likes_no);
} else {
mPostDetailLikesRecycler.setVisibility(View.VISIBLE);
mLikesNo.setVisibility(View.GONE);
mLikesAdapter.setLikesUserData(list);
mLikesAdapter.notifyDataSetChanged();
}
} else {
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
示例4: queryJoinedUser
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void queryJoinedUser() {
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("join", new BmobPointer(mActivity));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
if (list.size() > 0) {
if (users != null) {
users.clear();
}
users.addAll(list);
adapter.notifyDataSetChanged();
// 并设置人数
joinedNum.setText(list.size() + "");
} else {
showToast("服务器没有数据");
}
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("访问服务器失败,稍后重试" + e.getMessage() + e.getErrorCode());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例5: queryFocusUser
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void queryFocusUser() {
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("focus", new BmobPointer(user));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
if (list.size() > 0) {
if (users != null) {
users.clear();
}
users.addAll(list);
adapter.notifyDataSetChanged();
} else {
showToast("服务器没有数据");
}
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("访问服务器失败,稍后重试" + e.getMessage() + e.getErrorCode());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例6: requestFocus
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 请求获取用户关注其他用户
*/
public void requestFocus(User user, final RequestListener<List<User>> listener) {
if (!checkNet(listener)) return;
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("followPerson", new BmobPointer(user));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
listener.success(list);
} else {
listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
}
}
});
}
示例7: followUser
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 跟随该用户
*
* @param user
* @param listener
*/
public void followUser(final User user, final RequestListener<String> listener) {
if (!checkNet(listener)) return;
if (!checkLoginStatus(listener)) return;
final User currentUser = BmobUser.getCurrentUser(User.class);
BmobQuery<User> query = new BmobQuery<>();
query.addWhereEqualTo("followPerson", new BmobPointer(user));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e != null) return;
for (User u : list) {
if (u.getObjectId().equals(currentUser.getObjectId())) {
stopFollowRequest(user, listener);
listener.success("不再关注");
return;
}
}
startFollowRequest(user, listener);
listener.success("已经关注");
}
});
}
示例8: likeComment
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 喜欢文章
*
* @param post
* @param listener
*/
public void likeComment(final Post post, final RequestListener<String> listener) {
if (!checkNet(listener)) return;
if (!checkLoginStatus(listener)) return;
final User user = BmobUser.getCurrentUser(User.class);
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("likes", new BmobPointer(post));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e != null) return;
for (User u : list) {
if (u.getObjectId().equals(user.getObjectId())) {
removeLikeRequest(post, listener);
listener.success("取消收藏成功");
return;
}
}
startLikeRequest(post, listener);
}
});
}
示例9: getPostComment
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 获取文章的评论
*/
public void getPostComment(String postId, final RequestListener<List<Comment>> listener) {
if (!checkNet(listener)) return;
BmobQuery<Comment> query = new BmobQuery<>();
Post post = new Post();
post.setObjectId(postId);
query.addWhereEqualTo("post", new BmobPointer(post));
query.include("user");
query.order("-createdAt");
query.findObjects(new FindListener<Comment>() {
@Override
public void done(List<Comment> list, BmobException e) {
if (e == null) {
listener.success(list);
}
}
});
}
示例10: followUser
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 跟随该用户
*
* @param user
* @param listener
*/
public void followUser(final User user, final RequestListener<String> listener) {
if (!checkNet(listener)) return;
if (!checkLoginStatus(listener)) return;
final User currentUser = BmobUser.getCurrentUser(User.class);
BmobQuery<User> query = new BmobQuery<>();
query.addWhereEqualTo("followPerson", new BmobPointer(user));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e != null) return;
for (User u : list) {
if (u.getObjectId().equals(currentUser.getObjectId())) {
listener.error("已经关注过了哦!");
return;
}
}
startFollowRequest(user, listener);
}
});
}
示例11: likeComment
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
/**
* 喜欢文章
*
* @param post
* @param listener
*/
public void likeComment(final Post post, final RequestListener<String> listener) {
if (!checkNet(listener)) return;
if (!checkLoginStatus(listener)) return;
LogUtil.e3(post.getTitle() + ";" + post.getObjectId());
final User user = BmobUser.getCurrentUser(User.class);
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("likes", new BmobPointer(post));
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e != null) return;
for (User u : list) {
if (u.getObjectId().equals(user.getObjectId())) {
listener.error("已经添加过喜欢");
return;
}
}
startLikeRequest(post, listener);
}
});
}
示例12: getMyFavourite
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void getMyFavourite() {
User user = BmobUser.getCurrentUser(mContext, User.class);
if (user != null) {
BmobQuery<DianDi> query = new BmobQuery<DianDi>();
query.addWhereRelatedTo("favorite", new BmobPointer(user));
query.include("user");
query.order("createdAt");
query.setLimit(Constant.NUMBERS_PER_PAGE);
query.findObjects(mContext, new FindListener<DianDi>() {
@Override
public void onSuccess(List<DianDi> data) {
// TODO Auto-generated method stub
L.i(TAG, "get fav success!" + data.size());
ShowToast("fav size:" + data.size());
}
@Override
public void onError(int arg0, String arg1) {
// TODO Auto-generated method stub
ShowToast("获取收藏失败。请检查网络~");
}
});
}
}
示例13: getCommentData
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void getCommentData() {
BmobQuery<Comment> query = new BmobQuery<>();
Post post = new Post();
post.setObjectId(mPost.getObjectId());
query.addWhereEqualTo("post", new BmobPointer(post));
query.order("createdAt");
// 希望查询到评论发布者的具体信息 用下内部查询
// 这里稍复杂些 查询评论发布者的信息 和 帖子作者的信息
// 参见include的并列对象查询和内嵌对象的查询
query.include("user,post.author");
query.findObjects(new FindListener<Comment>() {
@Override
public void done(List<Comment> list, BmobException e) {
if (mPostDetailRefresh != null && mPostDetailRefresh.isRefreshing()) {
mPostDetailRefresh.setRefreshing(false);
if (e == null) {
if (list.isEmpty()) {
mCommentNo.setVisibility(View.VISIBLE);
mPostDetailCommentRecycler.setVisibility(View.GONE);
mCommentNo.setText(R.string.comment_no);
} else {
mCommentNo.setVisibility(View.GONE);
mPostDetailCommentRecycler.setVisibility(View.VISIBLE);
mAdapter.setCommentData(list);
mAdapter.notifyDataSetChanged();
}
} else {
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
}
});
}
示例14: getTags
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的package包/类
private void getTags() {
final List<String> s = new ArrayList<>();
BmobQuery<AccountBean> bmobQuery = new BmobQuery<>();
String id = MyApplication.getUser().getObjectId();
user.setObjectId(id);
bmobQuery.addWhereEqualTo("user", new BmobPointer(user));
bmobQuery.addQueryKeys("tag");
bmobQuery.findObjects(new FindListener<AccountBean>() {
@Override
public void done(List<AccountBean> object, BmobException e) {
if (e == null) {
Log.i("bmob", "查询成功:共" + object.size() + "条数据。");
//获取所有的tag
for (int j = 0; j < object.size(); j++) {
s.addAll(object.get(j).getTag());
}
List<Map.Entry<String, Integer>> tags;
List<Map.Entry<String, Integer>> tags_name;
tags = DataUtils.getTagList(mappingList, s);
tags_name = DataUtils.getTagListByName(mappingList, s);
String[] strings = new String[tags.size()];
String[] strings_name = new String[tags_name.size()];
for (int i = 0; i < tags.size(); i++) {
strings[i] = tags.get(i).getKey() + "(" + tags.get(i).getValue() + ")";
}
for (int i = 0; i < tags_name.size(); i++) {
strings_name[i] = tags_name.get(i).getKey() + "(" + tags_name.get(i).getValue() + ")";
}
mSearchView.initFlowView(strings);
mSearchView.initFlowViewByName(strings_name);
} else {
Log.i("bmob", "失败:" + e.getMessage() + "," + e.getErrorCode());
}
}
});
}
示例15: requestFocusNum
import cn.bmob.v3.datatype.BmobPointer; //导入依赖的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");
}
}
});
}