diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt index f7499cd..a8b38f2 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt @@ -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 } diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/PeerListActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/PeerListActivity.kt index 392b226..6345ae3 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/PeerListActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/PeerListActivity.kt @@ -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() } }