Created
June 28, 2020 21:53
-
-
Save NewtronLabs/144d7548bb52684a24bf817155b67efd 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
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