Search code examples
androidactivity-finish

Android: finish() does not finish, better ways to abort?


Ok, so I've finally stumbled on the intersting point that finish() does not immediately terminate an activity but instead will continue the calling method to its end and then "finish".

Is there any other way to terminate/abort an activity? Ie, if X then abort(); just bails immediately at that point without executing anything else from the activity?

tia


Solution

  • If you want the calling method to exit immediately, just call return; after you call finish().