Java tutorial
//package com.java2s; import android.content.Context; import android.content.Intent; public class Main { static final String EXTRA_MESSAGE = "message"; static final String DISPLAY_MESSAGE_ACTION = "com.google.android.gcm.demo.app.DISPLAY_MESSAGE"; public static void displayMessage(Context context, String message) { // TODO: Used for basic popup messages. Intent intent = new Intent(DISPLAY_MESSAGE_ACTION); intent.putExtra(EXTRA_MESSAGE, message); context.sendBroadcast(intent); } }