Created
August 25, 2020 04:44
-
-
Save vreamer/70eab6c93763e2e65aa31df94fdfb5d0 to your computer and use it in GitHub Desktop.
Handle user input
This file contains hidden or 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
| package com.example.direct_reply_notification | |
| import android.content.BroadcastReceiver | |
| import android.content.Context | |
| import android.content.Intent | |
| import android.util.Log | |
| import androidx.core.app.RemoteInput | |
| class NotificationReceiver : BroadcastReceiver() { | |
| override fun onReceive(context: Context, intent: Intent) { | |
| val remoteInput = RemoteInput.getResultsFromIntent(intent) | |
| if (remoteInput != null) { | |
| val title = remoteInput.getCharSequence( | |
| NotificationHelper.KEY_TEXT_REPLY).toString() | |
| Log.d("NotificationReceiver", title) // we will just log the user input for now | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment