package Ġcom . yp . bridge Ċ Ċ import Ġandroid . util . Log Ċ import Ġandroidx . lifecycle . Lifecycle Ċ import Ġandroidx . lifecycle . Lifecycle Observer Ċ import Ġandroidx . lifecycle . On Lifecycle Event Ċ Ċ /** Ċ Ġ* Ġ@ author Ġ: Ġy an pu Ċ Ġ* Ġ@ date Ġ: Ġ 2 0 2 1 / 5 / 1 9 Ċ Ġ* Ġ@ description : Ġ çĽĳåĲ¬ ç¨ĭåºı è¿Ľåħ¥ åīį åĲİåı° Ċ Ġ* Ċ Ġ* ĠApplication çĶŁåĳ½ åĳ¨æľŁ è§Ĥ å¯Ł ï¼Į æıĲä¾Ľ æķ´ä¸ª åºĶçĶ¨ è¿Ľç¨ĭ çļĦ çĶŁåĳ½ åĳ¨æľŁ Ċ Ġ* ĠLifecycle . Event . ON _ CREATE åıª ä¼ļ åĪĨ åıĳ ä¸Ģæ¬¡ ï¼Į Lifecycle . Event . ON _ DESTROY ä¸įä¼ļ è¢« åĪĨ åıĳ ãĢĤ Ċ Ġ* Ġ ç¬¬ä¸Ģä¸ª Activity è¿Ľåħ¥ æĹ¶ ï¼Į Process Lifecycle Owner å°Ĩ åĪĨ æ´¾ Lifecycle . Event . ON _ START , ĠLifecycle . Event . ON _ RE SU ME ãĢĤ Ċ Ġ* Ġ èĢĮ Lifecycle . Event . ON _ PAUSE , ĠLifecycle . Event . ON _ STOP ï¼Į å°Ĩ åľ¨ æľĢåĲİ ä¸Ģä¸ª Activity éĢĢåĩº åĲİ åĲİ å»¶ è¿ Ł åĪĨ åıĳ ãĢĤ Ċ Ġ* Ġå¦Ĥæŀľ çĶ±äºİ éħįç½® æĽ´æĶ¹ èĢĮ éĶĢ æ¯ ģ å¹¶ éĩįæĸ° åĪĽå»º æ´»åĬ¨ ï¼Į åĪĻ æŃ¤ å»¶ è¿ Ł è¶³ ä»¥ ä¿Ŀè¯ģ Process Lifecycle Owner ä¸įä¼ļ åıĳéĢģ ä»»ä½ķ äºĭä»¶ ãĢĤ Ċ Ġ*/ Ċ class ĠApplication Lifecycle Observer () Ġ: ĠLifecycle Observer Ġ{ ĊĊĠĠĠ Ġ@ On Lifecycle Event ( Lifecycle . Event . ON _ START ) ĊĠĠĠ Ġprivate Ġfun Ġon App Foreground () Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . e (" TAG ", Ġ" on App Foreground : Ġ è¿Ľåħ¥ åīį åı° ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ On Lifecycle Event ( Lifecycle . Event . ON _ STOP ) ĊĠĠĠ Ġprivate Ġfun Ġon App Background () Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . e (" TAG ", Ġ" on App Foreground : Ġ è¿Ľåħ¥ åĲİåı° ") ĊĠĠĠ Ġ} Ċ }