平成30/ 2018-12-19 17:42
Android/Notificationで取得の値を指定したActivityで利用したい

//___ 送信側
public class GCMIntentService extends GCMBaseIntentService {
    public void generateNotification(Context context, String message) {
        Intent intent = new Intent(context, MainActivity.class);
        intent.putExtra("gcm.txt", message);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
}

//___ 受信側
public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {

        String gcm_txt = getIntent().getStringExtra("gcm_txt");

        if (
        gcm_txt != null
        ){
            alertDialogBuilder.setMessage(gcm_txt).setNeutralButton("OK",null).show();
        }
    }
}