Skip to content

Instantly share code, notes, and snippets.

@NewtronLabs
Created June 28, 2020 21:53
Show Gist options
  • Save NewtronLabs/144d7548bb52684a24bf817155b67efd to your computer and use it in GitHub Desktop.
Save NewtronLabs/144d7548bb52684a24bf817155b67efd to your computer and use it in GitHub Desktop.
IpcEventBus-example1
public class Listener implements IIpcEventBusConnectionListener, IIpcEventBusObserver {
public Listener() {
String targetApp = "com.packagename";
IIpcEventBusConnector connector =
ConnectorFactory.getInstance().buildConnector(context, this, targetApp);
connector.startConnection();
}
@Override
public void onConnected(IIpcEventBusConnector connector) {
connector.registerObserver(this);
}
@Override
public void onEvent(IEventIpc event) {
Log.d("ipceventbus", "Received event: " + event.getClass().getSimpleName());
}
@Override
public void onDisconnected(IIpcEventBusConnector connector) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment