mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Use Adapter.notifyDataSetChanged() rather than View.invalidateViews().
This may help with bug #27, but it doesn't solve it in all cases (eg the contact's device restarting).
This commit is contained in:
@@ -39,6 +39,7 @@ import org.briarproject.api.lifecycle.LifecycleManager;
|
|||||||
import org.briarproject.api.messaging.GroupId;
|
import org.briarproject.api.messaging.GroupId;
|
||||||
import org.briarproject.api.transport.ConnectionListener;
|
import org.briarproject.api.transport.ConnectionListener;
|
||||||
import org.briarproject.api.transport.ConnectionRegistry;
|
import org.briarproject.api.transport.ConnectionRegistry;
|
||||||
|
|
||||||
import roboguice.activity.RoboActivity;
|
import roboguice.activity.RoboActivity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -269,7 +270,10 @@ ConnectionListener {
|
|||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
ContactListItem item = findItem(c);
|
ContactListItem item = findItem(c);
|
||||||
if(item != null) item.setHeaders(headers);
|
if(item != null) {
|
||||||
|
item.setHeaders(headers);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -299,10 +303,11 @@ ConnectionListener {
|
|||||||
public void run() {
|
public void run() {
|
||||||
ContactListItem item = findItem(c);
|
ContactListItem item = findItem(c);
|
||||||
if(item == null) return;
|
if(item == null) return;
|
||||||
if(LOG.isLoggable(INFO)) LOG.info("Updating connection time");
|
if(LOG.isLoggable(INFO))
|
||||||
|
LOG.info("Setting connection status " + connected);
|
||||||
item.setConnected(connected);
|
item.setConnected(connected);
|
||||||
item.setLastConnected(System.currentTimeMillis());
|
item.setLastConnected(System.currentTimeMillis());
|
||||||
list.invalidateViews();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user