本文整理汇总了Java中cn.bmob.v3.BmobQuery.getObject方法的典型用法代码示例。如果您正苦于以下问题:Java BmobQuery.getObject方法的具体用法?Java BmobQuery.getObject怎么用?Java BmobQuery.getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.getObject方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: loadDataByNet
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void loadDataByNet() {
BmobQuery<Content> query = new BmobQuery<>();
query.getObject(DetailActivity.this, mContent.getObjectId(), new GetListener<Content>() {
@Override
public void onSuccess(Content content) {
setData(content);
//把数据缓存到本地
SaveCacheAsyncTask savecaheTask = new SaveCacheAsyncTask(DetailActivity.this, content, CacheHelper.CONTENT_CACHE_KEY + mContent.getObjectId());
savecaheTask.execute();
mLoadingLayout.setLoadingLayout(LoadingLayout.HIDE_LAYOUT);
mScrollViewEx.setVisibility(View.VISIBLE);
}
@Override
public void onFailure(int i, String s) {
if (mLoadingLayout.getState() == LoadingLayout.STATE_REFRESH) {
mLoadingLayout.setLoadingLayout(LoadingLayout.NETWORK_ERROR);
}
}
});
}
示例3: syncUser
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void syncUser(final Context context, final String user_id,final Callback callback) {
BmobQuery<User> userQuery = new BmobQuery<User>();
userQuery.getObject(context, user_id, new GetListener<User>() {
@Override
public void onSuccess(User user) {
Logs.e("syncUser onSuccess");
PineApplication.mCurrentUser = user;
updateLocalUser(user);
if (null != callback)
callback.onSuccess();
}
@Override
public void onFailure(int i, String s) {
Logs.e("syncUser onFailure" + s);
}
});
}
示例4: setData
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void setData() {
User userInfo = BmobUser.getCurrentUser(MyCollectionActivity.this, User.class);
BmobQuery<User> query = new BmobQuery<User>();
final List<String> hobby = new ArrayList<>();
query.getObject(MyCollectionActivity.this, userInfo.getObjectId(), new GetListener<User>() {
@Override
public void onSuccess(User object) {
// TODO Auto-generated method stub
Message msg = new Message();
msg.what = UPDATE;
msg.obj = object.getHobby();
handler.sendMessage(msg);
}
@Override
public void onFailure(int i, String s) {
}
});
}
示例5: getLocalTimetableCourse
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
@Override
public void getLocalTimetableCourse(String timeCourseId, final LoadCourseCallback callback) {
BmobQuery<Course> singleCourseQuery = new BmobQuery<>();
singleCourseQuery.addWhereContains(
CoursePersistenceContract.CourseTimetableEntry.COLUMN_NAME_TIME_ID,timeCourseId);
singleCourseQuery.getObject(mContext, timeCourseId, new GetListener<Course>() {
@Override
public void onSuccess(Course course) {
callback.onCourseLoaded(course);
}
@Override
public void onFailure(int i, String s) {
callback.onDataError();
}
});
}
示例6: r
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void r()
{
BmobQuery<o> query = new BmobQuery<o>();
query.getObject(this, "b8e2da92f1", new GetListener<o>() {
@Override
public void onSuccess(o object)
{
String s=object.getContent();
String sr="fi";
if (s.equals(sr))
{
Toast.makeText(getApplicationContext(), "请更新到新版", Toast.LENGTH_SHORT).show();
finish();
}
else
{
}}
// .setCancelable(false).
@Override
public void onFailure(int code, String msg)
{
// finish();
}
});
}
示例7: xft
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void xft()
{
BmobQuery<i_a> query = new BmobQuery<i_a>();
query.getObject(WeiboListActivity.this, "03bf357e85", new GetListener<i_a>() {
@Override
public void onSuccess(i_a object)
{
String s = object.getContent();
String sr = nico.styTool.Constant.a_mi + "\n" + nico.styTool.Constant.a_miui;
if (s.equals(sr))
{
}
else
{
nico.styTool.ToastUtil.show(WeiboListActivity.this, "版本不一致,请更新", Toast.LENGTH_SHORT);
finish();
}
}
// .setCancelable(false).
@Override
public void onFailure(int code, String msg)
{
}
});
}
示例8: queryPost
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void queryPost(String objectId, final RequestListener<Post> listener) {
if (!checkNet(listener)) return;
BmobQuery<Post> query = new BmobQuery<>();
query.getObject(objectId, new QueryListener<Post>() {
@Override
public void done(Post post, BmobException e) {
if (e == null) {
listener.success(post);
} else {
listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
}
}
});
}
示例9: getNearbyAddress
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public static String getNearbyAddress(Nearby mNearby) {
final String[] address = new String[1];
BmobQuery<Nearby> query = new BmobQuery<>();
query.getObject(mNearby.getObjectId(), new QueryListener<Nearby>() {
@Override
public void done(Nearby nearby, BmobException e) {
if (null == e){
address[0] = nearby.getAddress();
}
}
});
return address[0];
}
示例10: initRecyclerOrderData
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void initRecyclerOrderData(List<CommodityOrder> commodityOrders) {
//用于从服务器请求得到的商品信息
commodities = new ArrayList<>();
//用于提交到服务器中的订单中的商品信息
commodityOrderSubmitList = new ArrayList<>();
for (final CommodityOrder commodityOrder : commodityOrders) {
BmobQuery<Commodity> bmobQuery = new BmobQuery<>();
bmobQuery.getObject(commodityOrder.getObjectId(), new QueryListener<Commodity>() {
@Override public void done(Commodity commodity, BmobException e) {
if (e != null) {
KLog.d("有异常:" + e.getMessage());
return;
}
if (commodity.getCount() <= 0 && currentStatus == KySet.CART_REQUEST_SUBMIT_ORDER) {
return;
}
KLog.d("读取成功,objectId:" + commodity.getObjectId() + "," + commodity.getName());
commodity.setCount(commodityOrder.getCount());
commodities.add(commodity);
commodityOrderSubmitList.add(commodityOrder);
recyclerAdapter.reloadData(commodities);
countTotalPrices();
}
});
}
}
示例11: initView
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void initView()
{
toolbar = (android.support.v7.widget.Toolbar)
findViewById(R.id.toolbar);
// 初始化Toolbar控件
setSupportActionBar(toolbar);
// 用Toolbar取代ActionBar
//toolbar.setTitleTextColor(getResources().getColor(R.color.text_font_white));//标题颜色
// toolbar.setSubtitleTextColor(getResources().getColor(R.color.text_font_white));//副标题颜色
username = (RelativeLayout) findViewById(R.id.lxw_user_profile_username);
usernameText = (TextView) findViewById(R.id.lxw_id_user_profile_username_text);
email = (TextView) findViewById(R.id.lxw_id_user_profile_email);
Img = (RelativeLayout) findViewById(R.id.lxw_user_profile_img);
userImg = (ImageView) findViewById(R.id.lxw_id_user_profile_userimg);
sex = (RelativeLayout) findViewById(R.id.lxw_user_profile_sex);
personality = (RelativeLayout) findViewById(R.id.lxw_user_profile_personality);
personalityText = (TextView) findViewById(R.id.lxw_user_profile_personality_text);
a = (TextView) findViewById(R.id.lxwuserprofileTextView1);
btn = (Button) findViewById(R.id.lxw_user_profile_btn_save);
BmobQuery<MyUser> query = new BmobQuery<MyUser>();
query.getObject(this, myUser.getObjectId(), new GetListener<MyUser>() {
@Override
public void onSuccess(MyUser object)
{
TextView sexText = (TextView) findViewById(R.id.lxw_id_user_profile_sex_text);
Integer ios = object.getSex();
sexText.setText(Integer.toString(ios));
if (object.getAddress().equals("激活"))
{
CheckBox cb = (CheckBox) findViewById(R.id.lxwuserprofileCheckBox2);
cb.setChecked(true);//选中
}
else
{
}
String s="" + object.getEmailVerified();
String sr="true";
if (s.equals(sr))
{
CheckBox b = (CheckBox) findViewById(R.id.lxwuserprofileCheckBox1);
b.setChecked(true);//选中
}
else
{
//Toast.makeText(WeiboListActivity.this, "未激活帐号最多(68字)", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(int code, String msg)
{
// TODO Auto-generated method stub
}
});
}
示例12: setData
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void setData(PlaceDetailBean.PlaceResult data) {
if (data != null) {
dataName = data.getName();
Log.d("name", dataName);
if (!data.getTelephone().isEmpty()) {
dataPhone = data.getTelephone();
} else
dataPhone = "无";
dataUrl = data.getUrl();
dataDescription = data.getDescription();
dataPrice = data.getTicket_info().getPrice();
dataOpernTime = data.getTicket_info().getOpen_time();
if (!(data.getTicket_info().getAttention() == null)) {
dataAtName = data.getTicket_info().getAttention().get(0).getName();
} else dataAtName = "没有详细信息";
if (!(data.getTicket_info().getAttention() == null)) {
dataAtDescription = data.getTicket_info().getAttention().get(0).getDescription();
} else dataAtDescription = "没有详细信息";
}
BmobQuery<User> query = new BmobQuery<User>();
query.getObject(PlaceDetailActivity.this, userInfo.getObjectId(), new GetListener<User>() {
@Override
public void onSuccess(User object) {
if (object.getHobby() != null) {
hobby.addAll(object.getHobby());
for (int i = 0; i < hobby.size(); i++) {
if (hobby.get(i).equals(dataName)) {
Flag = 1;
}
}
Log.d("Flag", String.valueOf(Flag));
if (Flag == 0) {
icCollect.setImageResource(R.drawable.ic_weishoucang);
}
if (Flag == 1)
icCollect.setImageResource(R.drawable.ic_shoucang);
initView();
}
}
@Override
public void onFailure(int code, String arg0) {
}
});
}