I do it like this:
RemoteViews views = new RemoteViews(..);
views.setOnClickPendingIntent(R.id.button1,pd);
noti.contentviews = views;
and
We can made custom notification and put buttons into that and also can perform different functionality on that onClick function, recently I was stuck in the same problem but this link
Handling buttons inside android notifications
save my life.
You can also see my code here Adding button action in custom notification
and it actually works on my HTC Sensation XE havent tried on other devices yet. So cheer and good luck
You cannot put interactive widgets, like a Button
, in a Notification
and get user input from them. These are for output display only.