在Android Wear应用程序中,如何监听Notification中的操作。就我而言,我在通知中有批准按钮和拒绝按钮。如果被攻击,如何听取动作。
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.sf)
.setContentTitle("John David")
.setContentText("Quote approval")
.setContentIntent(viewPendingIntent)
.setLargeIcon(BitmapFactory.decodeResource(
getResources(), R.drawable.prof))
.addAction(R.drawable.generic_confirmation_00170,
getString(R.string.agree), mapPendingIntent)
.addAction(R.drawable.ic_full_cancel,
getString(R.string.disagree), mapPendingIntent);