Created
June 28, 2020 21:41
-
-
Save NewtronLabs/81ba88fb3f1fc40b719a2b176c54a04e to your computer and use it in GitHub Desktop.
IpcEventBus-example1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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