activities/fragments' lifecycle methods called in the main thread?

时间:2016-04-21 21:53:45

标签: android multithreading android-fragments android-activity android-lifecycle

Are all activities/framgents' lifecycle methods called in the main thread by default? I'm implementing a class which checkes if the app is currently in foreground/background. I'm using activities' onPasue/onResume to do that. I would like to make sure that I don't have to synchronize methods of my class.

1 个答案:

答案 0 :(得分:2)

Yes, they are. In general, if something is called off the main thread the documentation will state so.