通知我需要在WhatsApp的實現Android Wear的通知等,其中每個對話是一個列表,並向右滑動允許用戶回覆到各自的談話。我嘗試從android開發人員示例堆疊,但它只顯示消息。我怎麼能設置超過1條消息,並像whatsapp中的相應操作?WhatsApp的像Android的磨損
編輯:
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);
我沒有做單獨的可穿戴式模塊,而是,我只是發送通知磨損。代碼無論如何都是添加的 – Vijai