0

I'm a bit confused with Android lifecycle. This is the transition diagram for reference: https://developer.android.com/images/activity_lifecycle.png

Consider this scenario: Activity is running -> another activity comes into the foreground -> onPause(). At this point, isn't the current activity no longer visible as another one has already come into the foreground? However, the diagram indicates that there are following cases:

1) onPause() -> user returns to the activity

2) onPause() -> activity is no longer visible -> onStop() -> user navigates to the activity

What's the difference between these flows?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
hixhix
  • 771
  • 7
  • 23
  • 1
    http://stackoverflow.com/questions/9266417/difference-between-onpause-and-onstop – Phillip Oct 23 '15 at 20:31
  • 1
    Think about a message you got on the screen, which hides partially your activity => onPause. Lets say you clicked that message and your messaging app is now taking the entire screen --> onStop() – SuperFrog Oct 23 '15 at 20:32

0 Answers0