package Ġcom . k her a . sample code . services Ċ Ċ import Ġandroid . app . Intent Service Ċ import Ġandroid . content . Intent Ċ import Ġandroidx . core . app . Remote Input Ċ import Ġcom . k her a . sample code . utils . Constant Strings Ċ import Ġcom . k her a . sample code . utils . Notification Utils . show Simple Notification Ċ Ċ class ĠNotification Reply Intent Ġ: ĠIntent Service ( Notification Reply Intent :: class . java . simple Name ) Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Handle Intent ( intent : ĠIntent ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdirect Reply Ġ= ĠgetMessage Text ( intent ) ĊĠĠĠĠĠĠĠ Ġif Ġ( direct Reply Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow Simple Notification ( application Context , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Reply ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Received : Ġ$ direct Reply ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠgetMessage Text ( intent : ĠIntent ?): ĠCharSequence ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġremote Input Ġ= ĠRemote Input . get Results From Intent ( intent ) ĊĠĠĠĠĠĠĠ Ġreturn Ġremote Input ?. get CharSequence ( Constant Strings . KEY _ TEXT _ REPLY ) ĊĠĠĠ Ġ} Ċ }