Cant understand isFinishing

I am learning Google IO 2012 code
In one of the actions (HomeActivity.java) they do the following:

void onCreate(Bundle savedInstance) { if(someCondition) { // start some other activity here finish(); // finish this activity } if(isFinishing()) return; // More code here } 

I wonder why they do not put return immediately after finish() , but instead checking isFinishing() ?

+6
source share
1 answer

Activity can be completed in several ways.

finishActivity from the action that called startActivityForResult

finishAffinity and finishFromChild

So isfinishing used to account for such cases.

+3
source

Source: https://habr.com/ru/post/928193/


All Articles