文件名称:Android 简单demo 演绎activity和fragment的生命周期
文件大小:612KB
文件格式:ZIP
更新时间:2022-04-29 11:11:55
简单demo
1.打开app: -MainActivity-->onCreate -MyFragment-->onAttach -MyFragment-->onCreate -MyFragment-->>onCreateView -MyFragment-->onActivityCreated -MainActivity-->onStart -MyFragment-->onStart -MainActivity-->onResume -MyFragment-->onResume 2.隐藏app -MyFragment-->onPause -MainActivity-->onPause -MyFragment-->onStop -MainActivity-->stop 3.点开隐藏的app -MainActivity-->onStart -MyFragment-->onStart -MainActivity-->onResume -MyFragment-->onResume 4.关闭app -MyFragment-->onPause -MainActivity-->onPause -MyFragment-->onStop -MainActivity-->stop -MyFragment-->onDestroyView -MyFragment-->onDestroy -MyFragment-->onDetach -MainActivity-->onDestroy