From bb26a842694d1fd53fb2f5b579e22521f0c76e31 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 29 Oct 2014 09:57:03 +0100 Subject: [PATCH] fixed intent managment --- .../conversations/ui/ConversationActivity.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 8a10a782..1d7364d6 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -244,7 +244,8 @@ public class ConversationActivity extends XmppActivity implements MenuItem menuSecure = menu.findItem(R.id.action_security); MenuItem menuArchive = menu.findItem(R.id.action_archive); MenuItem menuMucDetails = menu.findItem(R.id.action_muc_details); - MenuItem menuContactDetails = menu.findItem(R.id.action_contact_details); + MenuItem menuContactDetails = menu + .findItem(R.id.action_contact_details); MenuItem menuAttach = menu.findItem(R.id.action_attach_file); MenuItem menuClearHistory = menu.findItem(R.id.action_clear_history); MenuItem menuAdd = menu.findItem(R.id.action_add); @@ -625,8 +626,7 @@ public class ConversationActivity extends XmppActivity implements @Override protected void onNewIntent(Intent intent) { if (xmppConnectionServiceBound) { - if (intent != null - && VIEW_CONVERSATION.equals(getIntent().getType())) { + if (intent != null && VIEW_CONVERSATION.equals(intent.getType())) { handleViewConversationIntent(intent); } } else { @@ -679,6 +679,10 @@ public class ConversationActivity extends XmppActivity implements } else if (conversationList.size() <= 0) { startActivity(new Intent(this, StartConversationActivity.class)); finish(); + } else if (getIntent() != null + && VIEW_CONVERSATION.equals(getIntent().getType())) { + handleViewConversationIntent(getIntent()); + setIntent(null); } else if (mOpenConverstaion != null) { selectConversationByUuid(mOpenConverstaion); paneShouldBeOpen = mPanelOpen; @@ -687,10 +691,6 @@ public class ConversationActivity extends XmppActivity implements } swapConversationFragment(); mOpenConverstaion = null; - } else if (getIntent() != null - && VIEW_CONVERSATION.equals(getIntent().getType())) { - handleViewConversationIntent(getIntent()); - setIntent(null); } else { showConversationsOverview(); ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager() @@ -711,7 +711,7 @@ public class ConversationActivity extends XmppActivity implements } ExceptionHelper.checkForCrash(this, this.xmppConnectionService); } - + private void handleViewConversationIntent(Intent intent) { String uuid = (String) intent.getExtras().get(CONVERSATION); String text = intent.getExtras().getString(TEXT, null);