public void clearPendingComposingMessage() { ConversationProxy conversation = getConversation(); if (conversation != null) { conversation.setMessageCenterPendingMessage(null); conversation.setMessageCenterPendingAttachments(null); } }
public void savePendingComposingMessage() { Editable content = getPendingComposingContent(); SharedPreferences prefs = ApptentiveInternal.getInstance().getGlobalSharedPrefs(); SharedPreferences.Editor editor = prefs.edit(); ConversationProxy conversation = getConversation(); assertNotNull(conversation); if (conversation == null) { return; } if (content != null) { conversation.setMessageCenterPendingMessage(content.toString().trim()); } else { conversation.setMessageCenterPendingMessage(null); } JSONArray pendingAttachmentsJsonArray = new JSONArray(); // Save pending attachment for (ImageItem pendingAttachment : pendingAttachments) { pendingAttachmentsJsonArray.put(pendingAttachment.toJSON()); } if (pendingAttachmentsJsonArray.length() > 0) { conversation.setMessageCenterPendingAttachments(pendingAttachmentsJsonArray.toString()); } else { conversation.setMessageCenterPendingAttachments(null); } editor.apply(); }
conversation.setMessageCenterPendingAttachments(null);