本文整理汇总了Java中cn.bmob.v3.BmobObject类的典型用法代码示例。如果您正苦于以下问题:Java BmobObject类的具体用法?Java BmobObject怎么用?Java BmobObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BmobObject类属于cn.bmob.v3包,在下文中一共展示了BmobObject类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: uploadChatTableMessage
import cn.bmob.v3.BmobObject; //导入依赖的package包/类
private void uploadChatTableMessage(final GroupTableMessage groupTableMessage, SaveListener listener) {
List<String> groupNumber = groupTableMessage.getGroupNumber();
GroupTableMessage message;
List<String> copy = new ArrayList<>(groupNumber);
if (copy.contains(UserManager.getInstance().getCurrentUserObjectId())) {
copy.remove(UserManager.getInstance().getCurrentUserObjectId());
}
List<BmobObject> groupTableMessageList = new ArrayList<>();
for (int i = 0; i < copy.size(); i++) {
message = new GroupTableMessage();
message.setSendStatus(Constant.SEND_STATUS_SUCCESS);
message.setReadStatus(Constant.READ_STATUS_UNREAD);
message.setGroupDescription(groupTableMessage.getGroupDescription());
message.setGroupId(groupTableMessage.getGroupId());
message.setCreatedTime(groupTableMessage.getCreatedTime());
message.setToId(copy.get(i));
message.setGroupNumber(groupNumber);
message.setGroupAvatar(groupTableMessage.getGroupAvatar());
message.setGroupName(groupTableMessage.getGroupName());
message.setGroupNick(groupTableMessage.getGroupNick());
message.setNotification(groupTableMessage.getNotification());
message.setCreatorId(groupTableMessage.getCreatorId());
groupTableMessageList.add(message);
}
new BmobObject().insertBatch(CustomApplication.getInstance(), groupTableMessageList, listener);
}
示例2: insertObject
import cn.bmob.v3.BmobObject; //导入依赖的package包/类
private void insertObject(final BmobObject obj){
obj.save(AddBook.this, new SaveListener() {
@Override
public void onSuccess() {
// TODO Auto-generated method stub
findThisBook();
Toast.makeText(AddBook.this, "添加书籍成功", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(AddBook.this, MainActivity.class);
AddBook.this.startActivity(intent);
AddBook.this.finish();
}
@Override
public void onFailure(int arg0, String arg1) {
// TODO Auto-generated method stub
//ShowToast("-->创建数据失败:" + arg0+",msg = "+arg1);
Toast.makeText(AddBook.this, "添加书籍失败,请重新上传", Toast.LENGTH_SHORT).show();
}
});
}
示例3: BaseDataAdapter
import cn.bmob.v3.BmobObject; //导入依赖的package包/类
public BaseDataAdapter(Context context, List<? extends BmobObject> mDatas) {
this.context = context;
this.mDatas = mDatas;
options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.icon_live_item_default)
.showImageForEmptyUri(R.mipmap.icon_live_item_default)
.showImageOnFail(R.mipmap.icon_live_item_default)
.cacheInMemory(false)
.cacheOnDisk(true)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer())
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.build();
if (this.context == null) {
System.out.println("this.context is null");
} else {
mlayoutInflate = LayoutInflater.from(this.context);
}
}
示例4: saveTimetableCourses
import cn.bmob.v3.BmobObject; //导入依赖的package包/类
@Override
public void saveTimetableCourses(List<Course> courses) {
if (!courses.isEmpty() && mContext != null) {
new BmobObject().insertBatch(mContext, new ArrayList<BmobObject>(courses), new SaveListener() {
@Override
public void onSuccess() {
Log.d(tag,"bmob batch timetable courses saved successful.");
}
@Override
public void onFailure(int i, String s) {
Log.e(tag,"bmob batch timetable courses failure.");
}
});
} else {
Log.e(tag,"bmob batch insert cannot null");
}
}