/Signal

Primary LanguageKotlin

Signal


Kotlin,Android
ver 2.0

Used:Place The Slot.kt file into your project link


Create a receiver:

//Will work until you tell me to die

Slot(this, "slot1").onRun {it->
          val value = it.getStringExtra("param")
 }

or

//Will work once

Slot(this, "slot1",false).onRun {it->
          val value = it.getStringExtra("param")
 }

//it - intent


Run a signal to the receiver:

signal("slot1")
       .putExtra("param", "zaebis")
       .putExtra("run", false)
       .run(this)

//putExtra("run", true) - After receiving the alarm will do the rest
//putExtra("run", false) - After receiving the signal will be destroyed

//By default true, value = any(Intent.putExtra)