run response on UI thread

This commit is contained in:
Milos Kozak 2019-10-25 13:41:05 +02:00
parent f399f8bb1f
commit 6c4a6fac18

View file

@ -240,14 +240,14 @@ class ObjectivesFragment : Fragment() {
holder.start.setOnClickListener {
holder.start.visibility = View.INVISIBLE
NetworkChangeReceiver.fetch()
SntpClient.ntpTime(object : SntpClient.Callback() {
override fun run() {
if (objectives_fake.isChecked) {
objective.startedOn = time
objective.startedOn = DateUtil.now()
scrollToCurrentObjective()
startUpdateTimer()
RxBus.send(EventObjectivesUpdateGui())
} else
SntpClient.ntpTime(object : SntpClient.Callback() {
override fun run() {
activity?.runOnUiThread {
holder.start.visibility = View.VISIBLE
log.debug("NTP time: $time System time: ${DateUtil.now()}")