本文整理匯總了Java中cn.bmob.v3.BmobQuery類的典型用法代碼示例。如果您正苦於以下問題:Java BmobQuery類的具體用法?Java BmobQuery怎麽用?Java BmobQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BmobQuery類屬於cn.bmob.v3包,在下文中一共展示了BmobQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initWebView
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
/**
* 初始化網路數據:
*/
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)
{
}
});}
示例2: findWeibos
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
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_));
}
示例3: findWeibos_
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
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);
}
});
}
示例4: findComments
import cn.bmob.v3.BmobQuery; //導入依賴的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);
}
});}
示例5: startSearchUser
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
private void startSearchUser(final String username, final String password) {
BmobQuery<UserLogin> query = new BmobQuery<>();
query.addWhereEqualTo("username", username);
query.setLimit(1);
query.findObjects(new FindListener<UserLogin>() {
@Override
public void done(List<UserLogin> list, BmobException e) {
if (e == null && !list.isEmpty()) {
startLogin(list.get(0));
} else if (e == null) {
startRegister(username, password);
} else {
showNormalDia("溫馨提示", "登錄失敗!請檢查網絡連接");
Log.e(TAG, "query.findObjects: ", e);
}
}
});
}
示例6: query
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
public void query() {
BmobQuery<Order> queryData = new BmobQuery<Order>();
queryData.setLimit(15);
queryData.include("user");
queryData.findObjects(getActivity(), new FindListener<Order>() {
@Override
public void onSuccess(List<Order> list) {
if (list != null) {
mLists = list;
myItemAdapter.updateItems(mLists);
}
}
@Override
public void onError(int i, String s) {
Toast.makeText(getActivity(), "查詢失敗", Toast.LENGTH_SHORT).show();
}
});
}
示例7: refresh
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
public void refresh() {
BmobQuery<Order> queryData = new BmobQuery<Order>();
queryData.setLimit(15);
queryData.include("user");
queryData.findObjects(getActivity(), new FindListener<Order>() {
@Override
public void onSuccess(List<Order> list) {
if (list != null) {
mLists.clear();
mLists.addAll(list);
Toast.makeText(getActivity(), "刷新成功", Toast.LENGTH_SHORT).show();
myItemAdapter.updateItems(mLists);
refreshLayout.setRefreshing(false);
}
}
@Override
public void onError(int i, String s) {
Toast.makeText(getActivity(), "網絡出錯", Toast.LENGTH_SHORT).show();
refreshLayout.setRefreshing(false);
}
});
}
示例8: queryBlackList
import cn.bmob.v3.BmobQuery; //導入依賴的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);
}
}
);
}
示例9: checkNameExist
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
public void checkNameExist(final String name, final String password, final String phone, final String email) {
if (emptyChecked(name, password, phone)) {
ThreadUtils.runOnSubthread(new Runnable() {
@Override
public void run() {
BmobQuery<UserInfo> bmobQuery = new BmobQuery<>();
bmobQuery.addWhereEqualTo("username", name);
bmobQuery.findObjects(new FindListener<UserInfo>() {
@Override
public void done(List<UserInfo> list, BmobException e) {
if (list.size() > 0) {
iRegisterView.nameExist();
} else {
registe(name, password, phone, email);
}
}
});
}
});
}
}
示例10: getLikesData
import cn.bmob.v3.BmobQuery; //導入依賴的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();
}
}
});
}
示例11: getListFromNet
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
@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);
}
});
});
}
示例12: getMyAttentionList
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
@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);
}
});
});
}
示例13: queryPersonActivity
import cn.bmob.v3.BmobQuery; //導入依賴的package包/類
/**
* 查詢我參與的活動
*/
private void queryPersonActivity() {
BmobQuery<MActivity> query = new BmobQuery<>();
query.addWhereEqualTo("currentUser",currentUser);
query.include("currentUser");
query.order("-createdAt");
query.findObjects(new FindListener<MActivity>() {
@Override
public void done(List<MActivity> list, BmobException e) {
if (e == null) {
if (list.size() > 0) {
activities.clear();
activities.addAll(list);
activityAdapter.notifyDataSetChanged();
} else {
showToast("服務器沒有數據");
}
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("請求服務器失敗,請稍後重試" + e.getMessage() + e.getErrorCode());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例14: queryFanNum
import cn.bmob.v3.BmobQuery; //導入依賴的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());
}
}
});
}
示例15: queryJoinedUser
import cn.bmob.v3.BmobQuery; //導入依賴的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);
}
}
});
}