diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-13 16:48:39 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-13 16:48:39 +0200 |
commit | 9492e2890208ed8527504d692cfdb07d36d2fa30 (patch) | |
tree | 3638889168dc1bffdba605dcce01f1689f5fc773 /src/eu/siacs/conversations/ui | |
parent | a8010e71335daab3dfc3d6d523fd51755c9d6427 (diff) |
takeing pictures over intent
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationActivity.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index aed6f1e1..a94dc2e5 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -13,6 +13,7 @@ import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; +import eu.siacs.conversations.services.ImageProvider; import eu.siacs.conversations.utils.ExceptionHelper; import eu.siacs.conversations.utils.UIHelper; import android.net.Uri; @@ -352,6 +353,7 @@ public class ConversationActivity extends XmppActivity { private void takePicture() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, ImageProvider.getIncomingContentUri()); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE); } @@ -732,6 +734,26 @@ public class ConversationActivity extends XmppActivity { announcePgp(getSelectedConversation().getAccount(),getSelectedConversation()); } else if (requestCode == REQUEST_ENCRYPT_MESSAGE) { encryptTextMessage(); + } else if (requestCode == REQUEST_IMAGE_CAPTURE) { + this.pendingMessage = xmppConnectionService.attachImageToConversation(getSelectedConversation(), null, new UiCallback() { + + @Override + public void userInputRequried(PendingIntent pi) { + // TODO Auto-generated method stub + + } + + @Override + public void success() { + sendPendingImageMessage(); + } + + @Override + public void error(int errorCode) { + // TODO Auto-generated method stub + + } + }); } else { Log.d(LOGTAG,"unknown result code:"+requestCode); } |