简体   繁体   中英

When clicking back or home button, app goes back to activity's parent but onStart() isn't always called

I have activity A. When I go to settings from the Nav Drawer, I change some settings and back (via the back or home), most of the times the onStart() in activity A gets called.

This is where I load the shared Prefs.

However, sometimes onStart() doesn't get called and it goes directly to onResume(). Once this happens once, repeating this user interaction will always return to onResume() and not call onStart() of Activity A.

Any idea why?

我认为最好在onResume而不是onStart上执行此操作,因为如果应用程序暂停,重新启动或创建,则将调用onResume但是在onRestartonCreate之后会触发onStart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM