diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-18 22:15:33 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-18 22:15:33 +0100 |
commit | 0faec4ae1bc996d078cba24929646480206c40bf (patch) | |
tree | 8425e5e4a9001712e8709cca80ad0c1292af9586 /src/main/java/de/pixart/messenger | |
parent | 4ba3797c29dfacea5c7be3afb6cef42f2121afe8 (diff) |
fixed back and forth between Welcome- and EditAccountActivity
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/WelcomeActivity.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java index b28a7f414..f0235ce97 100644 --- a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java +++ b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java @@ -1,7 +1,7 @@ package de.pixart.messenger.ui; import android.Manifest; -import android.app.Activity; +import android.app.ActionBar; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; @@ -28,16 +28,26 @@ import java.io.InputStream; import java.io.OutputStream; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import java.util.List; import javax.crypto.NoSuchPaddingException; import de.pixart.messenger.Config; import de.pixart.messenger.R; +import de.pixart.messenger.entities.Account; import de.pixart.messenger.persistance.DatabaseBackend; import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.utils.EncryptDecryptFile; -public class WelcomeActivity extends Activity { +public class WelcomeActivity extends XmppActivity { + + @Override + protected void refreshUiReal() { + } + + @Override + void onBackendConnected() { + } private static final int REQUEST_READ_EXTERNAL_STORAGE = 0XD737; @@ -48,6 +58,11 @@ public class WelcomeActivity extends Activity { } super.onCreate(savedInstanceState); setContentView(R.layout.welcome); + final ActionBar ab = getActionBar(); + if (ab != null) { + ab.setDisplayShowHomeEnabled(false); + ab.setDisplayHomeAsUpEnabled(false); + } //check if there is a backed up database -- if (hasStoragePermission(REQUEST_READ_EXTERNAL_STORAGE)) { @@ -83,7 +98,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); } }); |