Refactored into onNavigateUp
This commit is contained in:
parent
04977aedc4
commit
b04fd2337e
|
@ -398,18 +398,23 @@ public class ManageAccountActivity extends XmppActivity {
|
||||||
case R.id.action_add_account:
|
case R.id.action_add_account:
|
||||||
addAccount();
|
addAccount();
|
||||||
break;
|
break;
|
||||||
case android.R.id.home:
|
|
||||||
if (xmppConnectionService.getConversations().size() == 0) {
|
|
||||||
startActivity(new Intent(getApplicationContext(),
|
|
||||||
ContactsActivity.class));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNavigateUp() {
|
||||||
|
if (xmppConnectionService.getConversations().size() == 0) {
|
||||||
|
startActivity(new Intent(this, ContactsActivity.class));
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return super.onNavigateUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void editAccount(Account account) {
|
private void editAccount(Account account) {
|
||||||
EditAccount dialog = new EditAccount();
|
EditAccount dialog = new EditAccount();
|
||||||
dialog.setAccount(account);
|
dialog.setAccount(account);
|
||||||
|
|
Loading…
Reference in a new issue