aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/XmppActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-13 21:37:27 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-13 21:37:27 +0100
commit9c811f8fb20b056ea12803e93e5ea20dc052bdcd (patch)
tree7c4be8327ca3722f41d7784c126081a92585c26c /src/eu/siacs/conversations/ui/XmppActivity.java
parent507cfba6ad481b078528ead056088e6aa6c4a3fc (diff)
sharing text
Diffstat (limited to 'src/eu/siacs/conversations/ui/XmppActivity.java')
-rw-r--r--src/eu/siacs/conversations/ui/XmppActivity.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java
index 1596a53a..dc8c3d5d 100644
--- a/src/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/eu/siacs/conversations/ui/XmppActivity.java
@@ -1,6 +1,7 @@
package eu.siacs.conversations.ui;
import eu.siacs.conversations.R;
+import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.services.XmppConnectionService.XmppConnectionBinder;
import eu.siacs.conversations.utils.ExceptionHelper;
@@ -103,4 +104,19 @@ public abstract class XmppActivity extends Activity {
super.onCreate(savedInstanceState);
ExceptionHelper.init(getApplicationContext());
}
+
+ public void switchToConversation(Conversation conversation, String text) {
+ Intent viewConversationIntent = new Intent(this,
+ ConversationActivity.class);
+ viewConversationIntent.setAction(Intent.ACTION_VIEW);
+ viewConversationIntent.putExtra(ConversationActivity.CONVERSATION,
+ conversation.getUuid());
+ if (text!=null) {
+ viewConversationIntent.putExtra(ConversationActivity.TEXT, text);
+ }
+ viewConversationIntent.setType(ConversationActivity.VIEW_CONVERSATION);
+ viewConversationIntent.setFlags(viewConversationIntent.getFlags()
+ | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(viewConversationIntent);
+ }
}