mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
commit
ca49603c85
@ -40,7 +40,8 @@
|
||||
android:name="eu.siacs.conversations.ui.ConversationActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/title_activity_conversations"
|
||||
android:windowSoftInputMode="stateHidden" >
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -398,18 +398,31 @@ public class ManageAccountActivity extends XmppActivity {
|
||||
case R.id.action_add_account:
|
||||
addAccount();
|
||||
break;
|
||||
case android.R.id.home:
|
||||
if (xmppConnectionService.getConversations().size() == 0) {
|
||||
startActivity(new Intent(getApplicationContext(),
|
||||
ContactsActivity.class));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNavigateUp() {
|
||||
if (xmppConnectionService.getConversations().size() == 0) {
|
||||
Intent contactsIntent = new Intent(this, ContactsActivity.class);
|
||||
contactsIntent.setFlags(
|
||||
// if activity exists in stack, pop the stack and go back to it
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TOP |
|
||||
// otherwise, make a new task for it
|
||||
Intent.FLAG_ACTIVITY_NEW_TASK |
|
||||
// don't use the new activity animation; finish animation runs instead
|
||||
Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||
startActivity(contactsIntent);
|
||||
finish();
|
||||
return true;
|
||||
} else {
|
||||
return super.onNavigateUp();
|
||||
}
|
||||
}
|
||||
|
||||
private void editAccount(Account account) {
|
||||
EditAccount dialog = new EditAccount();
|
||||
dialog.setAccount(account);
|
||||
|
@ -156,7 +156,9 @@ public abstract class XmppActivity extends Activity {
|
||||
}
|
||||
viewConversationIntent.setType(ConversationActivity.VIEW_CONVERSATION);
|
||||
if (newTask) {
|
||||
viewConversationIntent.setFlags(viewConversationIntent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_TASK_ON_HOME );
|
||||
viewConversationIntent.setFlags(viewConversationIntent.getFlags()
|
||||
| Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
} else {
|
||||
viewConversationIntent.setFlags(viewConversationIntent.getFlags()
|
||||
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
Loading…
Reference in New Issue
Block a user