Android 70??????????????
???????????? ???????[ 2013/4/12 10:17:06 ] ????????????
????38. ????????Activity??????????? ????????????????onCreate() --> onStart() --> onResume()????AAA???
????(1)??Activity?????Activity????Actvity???????Activity???????????
????AAA --> onFreeze() --> onPause() --> onStop() --> onRestart()--> onStart()??onResume() …
????(2)??????Home??Actvity???????????
????AAA --> onFreeze() --> onPause() --> onStop() -- Maybe -->onDestroy() – Maybe
????(3)????finish()?? Activity???????????
????AAA --> onPause() --> onStop() --> onDestroy()
????(4)??Activity?????dialog??Activity???????????
????AAA
????(5)???Activity?????????????????activity??Activity???????????
????AAA --> onFreeze() --> onPause()
????(6)?豸???????????Activity???????????
????AAA --> onFreeze() --> onPause()
????39. ????????Activity??????????????????????????????????浱???? onSaveInstanceState()
??????????????????Activity A?????????????????????????????μ?Activity B????????A?????onSaveInstanceState()??B?????????????A??????????????????????A???????????A??б?????????????A????μ???onCreate()????????????????????????onCreate()????????????savedInstanceState;???????????????onResume()??????onCreate()???
????40. ??ν????Activity???ó?????????? ??AndroidManifest.xml ?ж???Activity??????仰android:theme="@android:style/Theme.Dialog"??android:theme="@android:style/Theme.Translucent"?????????
????41. ??????Activity????????????????Activity??Application???????Activity?????????????????????finish()???ɡ?
????????????????killProcess()??System.exit()???????????
??????????????Activity????????????????Activity?????????????Activity??????????????????????????????????????????????Activity?????
????????????????????????
????????????????????????β???Home????????????keyCode???KEYCODE_HOME????????????????????framework??????????????????????????
???????????????????????????
?????????????а?????????????????
??????2.1???????????ActivityManager??restartPackage??????
??????????????????????á?????????????android.permission.RESTART_PACKAGES??
?????????????????????
???????????2.2??????????Ч???
??????2.2?????????μ??????killBackgroundProcesses()????????android.permission.KILL_BACKGROUND_PROCESSES??
????????????????2.2??restartPackage???????????????е?Ч????
??????????????????????????????ó????????????????????????forceStopPackage()??
????????????android.permission.FORCE_STOP_PACKAGES??
??????????????android:sharedUserId="android.uid.system"????
????????????????÷??????????????????????????????????????????????á?
????????????Android.mk?????LOCAL_CERTIFICATE := platform??
??????Android.mk????????Android????±??????????
????????????????????2.2????а?????????????????????????????????
?????????????????????ο???
????1??????????????
?????÷?????????????????ForceClose??
??????????????????????????????????????????????????????Force Close??????
????2?????????Activity??
??????????Activity?????????????????????????????Activity???ɡ?
????3?????????????
?????????????????????????????????????Activity????????????ɡ?
????4????????
????????μ?Activity????startActivityForResult????????????????onActivityResult?д??????????
???????????????????????????Activity?????????????????
?????????????????????????
????????????????????ó????????Activity????????nosensor????????Activity??????????sensor??????Ч???
??????????????????????????????????????á?
????????????????????Activity??????????Щ???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11