Showing posts with label doasync. Show all posts
Showing posts with label doasync. Show all posts

Wednesday, 5 August 2020

Working with UI controls from Non main thread in Kotlin


import org.jetbrains.anko.doAsync
import org.jetbrains.anko.uiThread


fun anyFunction(){
doAsync {
      // Normal code inside Async thread
      I=I+1
     If(I=100){

    uiThread {

        tvResult.setText =”I is now 100!!”
      }
    }
   //More code
   If(x==0){
     uiThread {

        tvResult.setText =”there’s some problem!”
      }
   }


}
}

Note: - you can include multiple uiThread inside same doAsync
          - you can include multiple doAsync inside any function

Raspberry pi: how to find raspberry pi model details

In the raspberry pi console type:    pinout output: ,--------------------------------. | oooooooooooooooooooo J8 +==== | 1oooooooooooooo...