hi,
i am able to add remoteview to notification window.from this link.
http://developer.android.com/guide/topics/ui/notifiers/notifications.html
now i have added four buttons and i want to handle the click events of
buttons from notification window.
and below is my code.i am able to add view to notification window but
i dont know how to define click events for buttons.
like its in native music player of android,when we exit the player
screen player running in background and we can do next,previous,play/
pause from notification window.
Notification notification = new Notification(
R.drawable.playbackstart, Trackname,0);
RemoteViews contentView=new
RemoteViews(getPackageName(),R.layout.demo);
notification.contentView = contentView;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
Intent intent = new Intent(getApplicationContext(), Main.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
intent, Intent.FLAG_ACTIVITY_NEW_TASK);
contentView.setOnClickPendingIntent(R.id.demoButton01,contentIntent);
contentView.setOnClickPendingIntent(R.id.demoButton02,contentIntent);
notification.contentIntent=contentIntent;
/* notification.setLatestEventInfo(this, Trackname, Artistname,
pendingIntent);
nm.notify(NOTIFY_ID, notification);*/
nm.notify(NOTIFY_ID, notification);
is there anyone to help me?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en