protected void onMessage(Context context, Intent intent) {
String msg = intent.getStringExtra("payload");
String newspushid1= intent.getStringExtra("payload1");
gc.setnews_pushid(newspushid1);
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
BackgroundAlert bg = new BackgroundAlert(mNotificationManager, msg);
bg.onReceive(getApplicationContext(), intent);
}
在這裏我得到了msg和Push id的值(分別爲helloworld和101)我想在另一個活動中獲得這個值。在android中無法獲取Push值
if (gdata.getPush_message() != null) {
String push_id_value = gdata.getnews_pushid();
Log.e("CATID", "ID-->" + push_id_value);
}
我已經使用這個代碼用於獲取價值。從GCMIntentService類,但我得到相同的值push_id_value,getPush_message其中世界您好我無法得到另一個動作和值101,請檢查我的代碼告訴另外活動我解決方案。
這裏是什麼'gdata'? –
它是seter和geter類的對象 – user3292460
哦,那麼罰款那麼你設置的價值? –