本文整理匯總了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) {
}
});
}