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) var ping = ping(dns.address, 53)
dns.ping = ping dns.ping = ping
adapter.addItem(dns)
runOnUiThread( runOnUiThread(
Runnable Runnable
{ {
adapter.addItem(dns)
adapter.sort() adapter.sort()
isLoading = false isLoading = false
} }

View File

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