Skip to content

Instantly share code, notes, and snippets.

@tajchert
Created March 24, 2015 16:09
Show Gist options
  • Save tajchert/53f728fadae7e3e9d77a to your computer and use it in GitHub Desktop.
Save tajchert/53f728fadae7e3e9d77a to your computer and use it in GitHub Desktop.
RemoteInput[] remoteInputs = new RemoteInput[notificationWear.remoteInputs.size()];
Intent localIntent = new Intent();
localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle localBundle = notificationWear.bundle;
int i = 0;
for(RemoteInput remoteIn : notificationWear.remoteInputs){
getDetailsOfNotification(remoteIn);
remoteInputs[i] = remoteIn;
localBundle.putCharSequence(remoteInputs[i].getResultKey(), "Our answer");//This work, apart from Hangouts as probably they need additional parameter (notification_tag?)
i++;
}
RemoteInput.addResultsToIntent(remoteInputs, localIntent, localBundle);
try {
notificationWear.pendingIntent.send(MainActivity.this, 0, localIntent);
} catch (PendingIntent.CanceledException e) {
Log.e(TAG, "replyToLastNotification error: " + e.getLocalizedMessage());
}
@AvaniRathod
Copy link

where to call reply() function ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment