2014-11-05 73 views
0

在Android Wear中,如何監聽通知中的操作。在我的情況下,我有通知中的批准按鈕和拒絕按鈕。如果聽取動作,如果它被竊聽。監聽器在Android Wear中的操作通知

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); 

回答