lancer025
lancer025

Reputation: 157

Stop() not called after activity switch

Android activity life cycle -> onCreate()->OnResume()->onPause()->Activity2_OnCreate()->Activity2_OnResume()->Activity1_OnStop()

While checking the flow via logs, OnStop of activity 1 is not called while switching to activity2. Is this phone specific as code runs fine i.e. onStop is being called on samsung note 2, coolpad. (So far tested) but not on MI note 3.

Upvotes: 0

Views: 267

Answers (1)

Doppie
Doppie

Reputation: 95

When an activity is put to background onStop is not necessarily called, you should use onPause to determine if your activity is going to the background.

onStop will be called when you finish your activity.

Upvotes: 1

Related Questions