diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 853693c2..985eced2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -162,6 +162,20 @@ android:enabled="true"> + + + + + + + + + + + + + + = LinkedList() + + fun registerListener(listener: OnAccountsUpdateListener, callImmediately: Boolean) { + listeners.add(listener) + if (callImmediately) + listener.onAccountsUpdated(null) + } + + fun unregisterListener(listener: OnAccountsUpdateListener) { + listeners.remove(listener) + } + } + +} diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountListFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/AccountListFragment.kt index c9efef77..2d6cc98c 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountListFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountListFragment.kt @@ -26,6 +26,7 @@ import android.widget.AbsListView import android.widget.AdapterView import android.widget.ArrayAdapter import android.widget.TextView +import com.etesync.syncadapter.AccountsChangedReceiver import com.etesync.syncadapter.App import com.etesync.syncadapter.R @@ -79,11 +80,11 @@ class AccountListFragment : ListFragment(), LoaderManager.LoaderCallbacks) {