Skip to content

Instantly share code, notes, and snippets.

@ricardoogliari
Created November 5, 2018 01:21
Show Gist options
  • Save ricardoogliari/427f57f9941ea8964eaa31b8a7060377 to your computer and use it in GitHub Desktop.
Save ricardoogliari/427f57f9941ea8964eaa31b8a7060377 to your computer and use it in GitHub Desktop.
mMessageListener = new MessageListener() {
@Override
public void onFound(Message message) {
String messageStr = new String(message.getContent());
partsMessage = messageStr.split(" ");
txtFacebook.setText("Facebook: " + partsMessage[0]);
txtTwitter.setText("Twitter: " + partsMessage[1]);
txtLinkedin.setText("Linkedin: " + partsMessage[2]);
Picasso.get().load(partsMessage[3]).into(imgPhoto);
ctnReceivedCard.setVisibility(View.VISIBLE);
ctnMyCard.setVisibility(View.GONE);
Toast.makeText(
MainActivity.this,
"Found message: " + new String(message.getContent()),
Toast.LENGTH_LONG).show();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment