Skip to content Skip to sidebar Skip to footer

How To Completely Finish My Activity, And After Activity.finish No Further Code Will Execute?

I want to completely finish my activity, and after activity.finish no further code will execute? Example: Intent scoringOpponentTeam = new Intent(this,TestActivitySecond.class); st

Solution 1:

When you are calling finish(), Android will let your code in the specific block after the finish() call execute, and that is why the log message appears. A simple return statement after the finish() call is the solution.

However, there is no need for you to explicity "kill" your Activity since Android handles this perfectly on its own.

Solution 2:

Solution 3:

You need a return statement after your this.finish();

Post a Comment for "How To Completely Finish My Activity, And After Activity.finish No Further Code Will Execute?"