diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-11-17 11:40:29 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-11-17 11:40:29 +0100 |
commit | 3f3b360eeeabf06c3b7c43ff05ad6ed8cf307473 (patch) | |
tree | 482af74c5ad0db5ab184bca9387f8d75bcc72ec5 /src/main/java/eu | |
parent | ad9a8c228144dd79fbb5ee5835920892e44b6425 (diff) |
fixed back and forth between Welcome- and EditAccountActivity
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java index 59d58db5..2c9fc131 100644 --- a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java @@ -8,22 +8,35 @@ import android.os.Bundle; import android.view.View; import android.widget.Button; +import java.util.List; + import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Account; + +public class WelcomeActivity extends XmppActivity { + + @Override + protected void refreshUiReal() { + + } + + @Override + void onBackendConnected() { -public class WelcomeActivity extends Activity { + } @Override protected void onCreate(final Bundle savedInstanceState) { if (getResources().getBoolean(R.bool.portrait_only)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } + super.onCreate(savedInstanceState); + setContentView(R.layout.welcome); final ActionBar ab = getActionBar(); if (ab != null) { ab.setDisplayShowHomeEnabled(false); ab.setDisplayHomeAsUpEnabled(false); } - super.onCreate(savedInstanceState); - setContentView(R.layout.welcome); final Button createAccount = (Button) findViewById(R.id.create_account); createAccount.setOnClickListener(new View.OnClickListener() { @Override @@ -37,7 +50,15 @@ public class WelcomeActivity extends Activity { useOwnProvider.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - startActivity(new Intent(WelcomeActivity.this, EditAccountActivity.class)); + List<Account> accounts = xmppConnectionService.getAccounts(); + Intent intent = new Intent(WelcomeActivity.this, EditAccountActivity.class); + if (accounts.size() == 1) { + intent.putExtra("jid",accounts.get(0).getJid().toBareJid().toString()); + intent.putExtra("init",true); + } else if (accounts.size() >= 1) { + intent = new Intent(WelcomeActivity.this, ManageAccountActivity.class); + } + startActivity(intent); } }); |