I want to completely finish my activity, and after activity.finish no further code will execute?
Example:
Intent scoringOpponentTeam = new Intent(this,TestActivitySecond.class);
startActivity(scoringOpponentTeam);
this.finish();
Log.i("after Finish Called", "after Finish Called--------"+"after Finish Called");
In above example, I want that no Log.i() line will execute.
When you are calling
finish(), Android will let your code in the specific block after thefinish()call execute, and that is why the log message appears. A simplereturnstatement after thefinish()call is the solution.However, there is no need for you to explicity “kill” your
Activitysince Android handles this perfectly on its own.