diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 2788516ef..55f41662f 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -134,6 +134,10 @@
android:name=".ui.ManageAccountActivity"
android:label="@string/title_activity_manage_accounts"
android:launchMode="singleTask" />
+
accountList = new ArrayList<>();
+ protected ListView accountListView;
+ protected AccountAdapter mAccountAdapter;
+
+ @Override
+ protected void refreshUiReal() {
+ synchronized (this.accountList) {
+ accountList.clear();
+ accountList.addAll(xmppConnectionService.getAccounts());
+ }
+ ActionBar actionBar = getActionBar();
+ if (actionBar != null) {
+ actionBar.setHomeButtonEnabled(this.accountList.size() > 0);
+ actionBar.setDisplayHomeAsUpEnabled(this.accountList.size() > 0);
+ }
+ mAccountAdapter.notifyDataSetChanged();
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.manage_accounts);
+
+ accountListView = (ListView) findViewById(R.id.account_list);
+ this.mAccountAdapter = new AccountAdapter(this, accountList, false);
+ accountListView.setAdapter(this.mAccountAdapter);
+ accountListView.setOnItemClickListener(new OnItemClickListener() {
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View view,
+ int position, long arg3) {
+ final Account account = accountList.get(position);
+ final String body = getIntent().getStringExtra(EXTRA_BODY);
+
+ try {
+ final Jid contact = Jid.fromString(getIntent().getStringExtra(EXTRA_CONTACT));
+ final Conversation conversation = xmppConnectionService.findOrCreateConversation(
+ account, contact, false, false);
+ switchToConversation(conversation, body, false);
+ } catch (InvalidJidException e) {
+ // ignore error
+ }
+
+ finish();
+ }
+ });
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ final int theme = findTheme();
+ if (this.mTheme != theme) {
+ recreate();
+ }
+ }
+
+ @Override
+ void onBackendConnected() {
+ final int numAccounts = xmppConnectionService.getAccounts().size();
+
+ if (numAccounts == 1) {
+ final String body = getIntent().getStringExtra(EXTRA_BODY);
+ final Account account = xmppConnectionService.getAccounts().get(0);
+
+ try {
+ final Jid contact = Jid.fromString(getIntent().getStringExtra(EXTRA_CONTACT));
+ final Conversation conversation = xmppConnectionService.findOrCreateConversation(
+ account, contact, false, false);
+ switchToConversation(conversation, body, false);
+ } catch (InvalidJidException e) {
+ // ignore error
+ }
+
+ finish();
+ } else {
+ refreshUiReal();
+ }
+ }
+}
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index 1b0f4565a..25688d171 100644
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -20,6 +20,7 @@
Mit Unterhaltung teilen
Unterhaltung beginnen
Kontakt auswählen
+ Über Account teilen
Sperrliste
gerade
vor einer Minute
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 834870e7e..ab89fe8de 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -21,6 +21,7 @@
Share with Conversation
Start Conversation
Choose Contact
+ Share via account
Block list
just now
1 min ago