71.8 Updating the Notification
After sending the reply within the notification you may have noticed that the progress indicator continues to spin within the notification panel as highlighted in Figure 71-4:
Figure 71-4
The notification is showing this indicator because it is waiting for a response from the activity confirming receipt of the sent text. The recommended approach to performing this task is to update the notification with a new message indicating that the reply has been received and handled. Since the original notification was assigned an ID when it was issued, this can be used once again to perform an update. Add the following code to the handleIntent() method to perform this task:
private fun handleIntent() {
val intent = this.intent
val remoteInput = RemoteInput.getResultsFromIntent(intent)
if (remoteInput != null) {
...