Skip to content

Instantly share code, notes, and snippets.

@guilhermecarvalhocarneiro
Created March 24, 2014 15:30
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 guilhermecarvalhocarneiro/9742501 to your computer and use it in GitHub Desktop.
Save guilhermecarvalhocarneiro/9742501 to your computer and use it in GitHub Desktop.
BroadCastReceiver GCM
public class MessageBroadCast extends BroadcastReceiver {
String tag = "Mensagem";
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
try {
if(extras != null){
Log.i(tag, "Mensagem" + extras.getString("param1", "Nada"));
}
} catch (Exception e) {
Log.e("Mensagem Erro", e.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment