Skip to content

Instantly share code, notes, and snippets.

@NewtronLabs
Created June 28, 2020 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NewtronLabs/81ba88fb3f1fc40b719a2b176c54a04e to your computer and use it in GitHub Desktop.
Save NewtronLabs/81ba88fb3f1fc40b719a2b176c54a04e to your computer and use it in GitHub Desktop.
IpcEventBus-example1
class Listener : IIpcEventBusConnectionListener, IIpcEventBusObserver {
init {
val targetApp = "com.packagename"
val connector = ConnectorFactory.getInstance().buildConnector(context, this, targetApp)
connector.startConnection()
}
override fun onConnected(connector: IIpcEventBusConnector) {
connector.registerObserver(this)
}
override fun onEvent(event: IEventIpc) {
Log.d("ipceventbus", "Received event: " + event)
}
override fun onDisconnected(connector: IIpcEventBusConnector) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment