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