pull/146/head
M66B 6 years ago
parent 787e4a983e
commit 271a36cde5

@ -1376,10 +1376,9 @@ public class FragmentCompose extends FragmentEx {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
EntityAccount account = (EntityAccount) parent.getAdapter().getItem(position); EntityAccount account = (EntityAccount) parent.getAdapter().getItem(position);
if (liveIdentities == null) if (liveIdentities != null)
liveIdentities = db.identity().liveIdentities(account.id, true);
else
liveIdentities.removeObservers(getViewLifecycleOwner()); liveIdentities.removeObservers(getViewLifecycleOwner());
liveIdentities = db.identity().liveIdentities(account.id, true);
liveIdentities.observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() { liveIdentities.observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
@Override @Override

@ -86,8 +86,10 @@ public class ServiceTileUnseen extends TileService {
public void onStopListening() { public void onStopListening() {
Log.i(Helper.TAG, "Stop tile unseen"); Log.i(Helper.TAG, "Stop tile unseen");
if (liveMessages != null) if (liveMessages != null) {
liveMessages.removeObservers(owner); liveMessages.removeObservers(owner);
liveMessages = null;
}
} }
public void onClick() { public void onClick() {

Loading…
Cancel
Save