From 0de9d57420e74282b09b7963017137fd32c98876 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 21 May 2014 16:43:19 +0200 Subject: cleaned up shared text --- src/eu/siacs/conversations/ui/XmppActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/eu/siacs/conversations/ui/XmppActivity.java') diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 02900ac8..7c8c46b2 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -145,7 +145,7 @@ public abstract class XmppActivity extends Activity { ExceptionHelper.init(getApplicationContext()); } - public void switchToConversation(Conversation conversation, String text) { + public void switchToConversation(Conversation conversation, String text, boolean newTask) { Intent viewConversationIntent = new Intent(this, ConversationActivity.class); viewConversationIntent.setAction(Intent.ACTION_VIEW); @@ -155,8 +155,12 @@ public abstract class XmppActivity extends Activity { viewConversationIntent.putExtra(ConversationActivity.TEXT, text); } viewConversationIntent.setType(ConversationActivity.VIEW_CONVERSATION); - viewConversationIntent.setFlags(viewConversationIntent.getFlags() + if (newTask) { + viewConversationIntent.setFlags(viewConversationIntent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_TASK_ON_HOME ); + } else { + viewConversationIntent.setFlags(viewConversationIntent.getFlags() | Intent.FLAG_ACTIVITY_CLEAR_TOP); + } startActivity(viewConversationIntent); } -- cgit v1.2.3