コード例 #1
0
 private void addAttachmentImage(Uri imageUri) {
   try {
     attachmentManager.setImage(imageUri);
   } catch (IOException e) {
     Log.w(TAG, e);
     attachmentManager.clear();
     Toast.makeText(
             this,
             R.string.ConversationActivity_sorry_there_was_an_error_setting_your_attachment,
             Toast.LENGTH_LONG)
         .show();
   } catch (BitmapDecodingException e) {
     Log.w(TAG, e);
     attachmentManager.clear();
     Toast.makeText(
             this,
             R.string.ConversationActivity_sorry_there_was_an_error_setting_your_attachment,
             Toast.LENGTH_LONG)
         .show();
   }
 }
コード例 #2
0
 private void addAttachmentAudio(Uri audioUri) {
   try {
     attachmentManager.setAudio(audioUri);
   } catch (IOException e) {
     attachmentManager.clear();
     Toast.makeText(
             this,
             R.string.ConversationActivity_sorry_there_was_an_error_setting_your_attachment,
             Toast.LENGTH_LONG)
         .show();
     Log.w("ComposeMessageActivity", e);
   } catch (MediaTooLargeException e) {
     attachmentManager.clear();
     Toast.makeText(
             this,
             R.string
                 .ConversationActivity_sorry_the_selected_audio_exceeds_message_size_restrictions,
             Toast.LENGTH_LONG)
         .show();
     Log.w("ComposeMessageActivity", e);
   }
 }
コード例 #3
0
  private void sendComplete(Recipients recipients, long threadId, boolean refreshFragment) {
    attachmentManager.clear();
    composeText.setText("");

    this.recipients = recipients;
    this.threadId = threadId;

    ConversationFragment fragment =
        (ConversationFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_content);
    if (refreshFragment) {
      fragment.reload(recipients, threadId);

      initializeTitleBar();
      initializeSecurity();
    }
    fragment.scrollToBottom();
  }