我已創建自定義通知。在這個通知中我有一個按鈕。我的問題是,當我點擊按鈕,我似乎無法將任何額外的新課程傳遞給新課程。捆綁包始終爲空
這是我使用的按鈕代碼:
// notification button
Intent switchIntent = new Intent(context, SecondClass.class);
switchIntent.putExtra("passThis", passThisValue);
PendingIntent pendingSwitchIntent = PendingIntent.getBroadcast(context, 0, switchIntent, 0);
contentView.setOnClickPendingIntent(R.id.button, pendingSwitchIntent);
類我想要的演員:
包是空百達。如果您需要完整的代碼我將編輯我的帖子,我只發佈了代碼中我認爲問題所在的部分。
我沒有正確地做到這一點?我應該如何將值傳遞給通知按鈕事件上的類?
這是工作,但我覺得很奇怪,因爲我已經嘗試這個問題。唯一的區別是,現在我先卸載應用程序,進行更改並重新安裝。那麼,工作......謝謝! – Ravers
@Raverrs謝謝..你可以接受這個作爲你的答案。它有助於。 – thedarkpassenger