package Ġcom . example . home food activity Ċ Ċ import Ġandroidx . lifecycle . Lifecycle Ċ import Ġandroidx . lifecycle . Lifecycle Observer Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġandroidx . lifecycle . On Lifecycle Event Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . subjects . Publish Subject Ċ Ċ class ĠLifecycle Observer Ġ: ĠLifecycle Observer Ġ{ ĊĊĠĠĠ Ġval Ġlifecycle : ĠObservable < Lifecycle . Event > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ lifecycle ĊĠĠĠ Ġprivate Ġval Ġ_ lifecycle Ġ= ĠPublish Subject . create < Lifecycle . Event >() ĊĊĠĠĠ Ġ@ Suppress (" UNUSED _ PARAMETER ") ĊĠĠĠ Ġ@ On Lifecycle Event ( Lifecycle . Event . ON _ ANY ) ĊĠĠĠ Ġfun Ġon Any ( source : ĠLifecycle Owner , Ġevent : ĠLifecycle . Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ lifecycle . onNext ( event ) ĊĠĠĠ Ġ} Ċ } Ċ