fixed intent managment
This commit is contained in:
parent
a11e6dda8f
commit
bb26a84269
|
@ -244,7 +244,8 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
MenuItem menuSecure = menu.findItem(R.id.action_security);
|
MenuItem menuSecure = menu.findItem(R.id.action_security);
|
||||||
MenuItem menuArchive = menu.findItem(R.id.action_archive);
|
MenuItem menuArchive = menu.findItem(R.id.action_archive);
|
||||||
MenuItem menuMucDetails = menu.findItem(R.id.action_muc_details);
|
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 menuAttach = menu.findItem(R.id.action_attach_file);
|
||||||
MenuItem menuClearHistory = menu.findItem(R.id.action_clear_history);
|
MenuItem menuClearHistory = menu.findItem(R.id.action_clear_history);
|
||||||
MenuItem menuAdd = menu.findItem(R.id.action_add);
|
MenuItem menuAdd = menu.findItem(R.id.action_add);
|
||||||
|
@ -625,8 +626,7 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
if (xmppConnectionServiceBound) {
|
if (xmppConnectionServiceBound) {
|
||||||
if (intent != null
|
if (intent != null && VIEW_CONVERSATION.equals(intent.getType())) {
|
||||||
&& VIEW_CONVERSATION.equals(getIntent().getType())) {
|
|
||||||
handleViewConversationIntent(intent);
|
handleViewConversationIntent(intent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -679,6 +679,10 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
} else if (conversationList.size() <= 0) {
|
} else if (conversationList.size() <= 0) {
|
||||||
startActivity(new Intent(this, StartConversationActivity.class));
|
startActivity(new Intent(this, StartConversationActivity.class));
|
||||||
finish();
|
finish();
|
||||||
|
} else if (getIntent() != null
|
||||||
|
&& VIEW_CONVERSATION.equals(getIntent().getType())) {
|
||||||
|
handleViewConversationIntent(getIntent());
|
||||||
|
setIntent(null);
|
||||||
} else if (mOpenConverstaion != null) {
|
} else if (mOpenConverstaion != null) {
|
||||||
selectConversationByUuid(mOpenConverstaion);
|
selectConversationByUuid(mOpenConverstaion);
|
||||||
paneShouldBeOpen = mPanelOpen;
|
paneShouldBeOpen = mPanelOpen;
|
||||||
|
@ -687,10 +691,6 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
}
|
}
|
||||||
swapConversationFragment();
|
swapConversationFragment();
|
||||||
mOpenConverstaion = null;
|
mOpenConverstaion = null;
|
||||||
} else if (getIntent() != null
|
|
||||||
&& VIEW_CONVERSATION.equals(getIntent().getType())) {
|
|
||||||
handleViewConversationIntent(getIntent());
|
|
||||||
setIntent(null);
|
|
||||||
} else {
|
} else {
|
||||||
showConversationsOverview();
|
showConversationsOverview();
|
||||||
ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager()
|
ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager()
|
||||||
|
@ -711,7 +711,7 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
}
|
}
|
||||||
ExceptionHelper.checkForCrash(this, this.xmppConnectionService);
|
ExceptionHelper.checkForCrash(this, this.xmppConnectionService);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleViewConversationIntent(Intent intent) {
|
private void handleViewConversationIntent(Intent intent) {
|
||||||
String uuid = (String) intent.getExtras().get(CONVERSATION);
|
String uuid = (String) intent.getExtras().get(CONVERSATION);
|
||||||
String text = intent.getExtras().getString(TEXT, null);
|
String text = intent.getExtras().getString(TEXT, null);
|
||||||
|
|
Loading…
Reference in a new issue