Whatsapp like notification in android wear -


i need achieve notification in android wear in whatsapp each conversation list , sliding right allows user reply respective conversation. tried stacking android developers example displays messages is. how set more 1 message , respective action in whatsapp?

edit:

  notificationcompat.wearableextender wearoptions =   new notificationcompat.wearableextender()    .sethinthideicon(true);    string replylabel = mxmppconnectionservice.getresources().getstring(r.string.wear_reply);   remoteinput remoteinput = new remoteinput.builder(extra_voice_reply)                 .setlabel(replylabel)                 .build();   intent replyintent = new intent(mxmppconnectionservice, xmppconnectionservice.class);  pendingintent replypendingintent =  pendingintent.getactivity(mxmppconnectionservice, 0, replyintent,                                       pendingintent.flag_update_current);   notificationcompat.action action =                   new notificationcompat.action.builder(r.mipmap.ic_launcher,                         "reply to", replypendingintent)                         .addremoteinput(remoteinput)                         .build();  final builder mbuilder;  mbuilder.setdefaults(0);  mbuilder.setsmallicon(r.drawable.ic_notification);  mbuilder.setpriority(getpriority());  mbuilder.setdeleteintent(createdeleteintent());  mbuilder.setlights(0xff00ff00, 2000, 3000)     .extend(wearoptions)     .extend(new notificationcompat.wearableextender().addaction(action));   final notification notification = mbuilder.build();             notificationmanager.notify(notification_id, notification); 

you missing 3 different things:

  1. you not calling setgroup("grop_name") on notificationbuilder
  2. notifications belong same group must have different ids. if notify same id, notification_id in case, ste stacking not work
  3. you want different replypendingintent each notification, otherwise pending intent refer last notification notified. instead of hard-coding 0, pass different value each notification.

the rest looks good,


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -