Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MyBroadcastReceiver(val listener : MyBroadcastListener) extends BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
interface MyBroadcastListener {
fun onSomeEventHappened()
class MyPresenter extends Presenter implements MyBroadcastReceiver.MyBroadcastListener {
override fun onSomeEventHappened() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
class MyActivity extends Activity {
override fun onCreate() {
val presenter = MyPresenter()
val receiver = MyBroadcastReceiver(presenter)
//register receiver...
val filter = IntentFilter(...)
this.registerReceiver(br, filter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment