wujunbin
wujunbin

Reputation: 361

Lifecycle issue between activity and fragment

I encountered a problem on Nexus 9 .(System Version Android marshmallow) On android system before Android marshmallow, fragmentA callback onStop will be called, when activity state containing fragmentA is Stopped. fragmentA callbacks onDestroyView, onDestroy and onDetach will be called when activity state containing fragmentA is Destroyed. The processes was described in official website

Recently, I found out that on android marshmallow fragmentA callbacks onStop, onDestroyView, onDestroy and onDetach will be called continuously when activity state containing fragmentA is Stopped.

Upvotes: 0

Views: 211

Answers (1)

wujunbin
wujunbin

Reputation: 361

Sorry, I finally solved this issue. The issue I post was not correct. When activity state is Stopped, fragment callback onStop will be called normally. There was no problem. The issue above was caused by that activity called the onDestroy method when I opened the "Don't keep activities" option in Developer Options. The issue was solved at this.

Upvotes: 1

Related Questions