Created
March 24, 2015 16:09
-
-
Save tajchert/53f728fadae7e3e9d77a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where to call reply() function ??