Esempio n. 1
0
 private void saveNote() {
   view.hideKeyBoard();
   if (TextUtils.isEmpty(view.getLabelText())) {
     note.setLabel(mContext.getString(R.string.default_label));
   } else {
     note.setLabel(view.getLabelText());
   }
   note.setContent(view.getContentText());
   note.setLastOprTime(TimeUtils.getCurrentTimeInLong());
   note.setStatus(SNote.Status.NEED_PUSH.getValue());
   event = new MainPresenter.NotifyEvent<>();
   switch (operateMode) {
     case CREATE_NOTE_MODE:
       note.setCreateTime(TimeUtils.getCurrentTimeInLong());
       event.setType(MainPresenter.NotifyEvent.CREATE_NOTE);
       mFinalDb.saveBindId(note);
       break;
     default:
       event.setType(MainPresenter.NotifyEvent.UPDATE_NOTE);
       mFinalDb.update(note);
       break;
   }
   event.setData(note);
   view.finishView();
 }
  private boolean saveFriendListDb(String cvos) {
    Log.d(TAG, "saveFriendListDb()");
    try {
      friendListVo = new FriendListVo();
      friendListVo.setUid(userInfoVo.getUid());
      friendListVo.setUpdateTime(System.currentTimeMillis() + "");

      friendListVo.setFriends(cvos);
      finalDb.update(friendListVo);
      return true;
    } catch (Exception e) {
      return false;
    }
  }
 public void UpateModel(Object model) {
   db.update(model);
 }