Skip to content

Instantly share code, notes, and snippets.

@ricardoogliari
Created November 5, 2018 01:35
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 ricardoogliari/9cdc03f42cbdd2724e4a2cfdd2a614c9 to your computer and use it in GitHub Desktop.
Save ricardoogliari/9cdc03f42cbdd2724e4a2cfdd2a614c9 to your computer and use it in GitHub Desktop.
@Override
public void onStart() {
super.onStart();
Nearby.getMessagesClient(this).subscribe(mMessageListener);
}
@Override
public void onStop() {
if (message != null)
Nearby.getMessagesClient(this).unpublish(message);
Nearby.getMessagesClient(this).unsubscribe(mMessageListener);
super.onStop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment