finish()
doesn't close the app. It only closes the current activity. So after finishing an activity the natural behavior is going back to the last activity of activity stack.
So now you have multiple options
- finish the previous activity before starting next one
- startactivityforresult to start second activity. When finished you can catch in onActivityResult to finish.
There are also other possible options.