1. fixed dynamic peers list crash

This commit is contained in:
vadym 2020-06-30 05:47:26 -07:00
parent 9306593012
commit 04f2537145
2 changed files with 4 additions and 4 deletions

View File

@ -71,10 +71,10 @@ class DNSListActivity : AppCompatActivity() {
}
var ping = ping(dns.address, 53)
dns.ping = ping
adapter.addItem(dns)
runOnUiThread(
Runnable
{
adapter.addItem(dns)
adapter.sort()
isLoading = false
}

View File

@ -93,9 +93,9 @@ class PeerListActivity : AppCompatActivity() {
}
var ping = ping(address, url.port)
peerInfo.ping = ping
adapter.addItem(peerInfo)
if(adapter.count % 5 == 0) {
withContext(Dispatchers.Main) {
withContext(Dispatchers.Main) {
adapter.addItem(peerInfo)
if(adapter.count % 5 == 0) {
adapter.sort()
}
}