run response on UI thread
This commit is contained in:
parent
f399f8bb1f
commit
6c4a6fac18
1 changed files with 10 additions and 10 deletions
|
@ -240,14 +240,14 @@ class ObjectivesFragment : Fragment() {
|
||||||
holder.start.setOnClickListener {
|
holder.start.setOnClickListener {
|
||||||
holder.start.visibility = View.INVISIBLE
|
holder.start.visibility = View.INVISIBLE
|
||||||
NetworkChangeReceiver.fetch()
|
NetworkChangeReceiver.fetch()
|
||||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
|
||||||
override fun run() {
|
|
||||||
if (objectives_fake.isChecked) {
|
if (objectives_fake.isChecked) {
|
||||||
objective.startedOn = time
|
objective.startedOn = DateUtil.now()
|
||||||
scrollToCurrentObjective()
|
scrollToCurrentObjective()
|
||||||
startUpdateTimer()
|
startUpdateTimer()
|
||||||
RxBus.send(EventObjectivesUpdateGui())
|
RxBus.send(EventObjectivesUpdateGui())
|
||||||
} else
|
} else
|
||||||
|
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||||
|
override fun run() {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
holder.start.visibility = View.VISIBLE
|
holder.start.visibility = View.VISIBLE
|
||||||
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue