what happens to the rest of the code of older activity after starting a new activity? here 'doSomeWork()' is called or not? does startActivity() work as a return statement?
public void method(){
Intent intent = new Intent(this, newactivity.class);
startActivity(intent);
doSomeWork();
}
here 'doSomeWork()' is called or not?
It will be called immediately. startActivity()
is not a blocking call. newactivity
will not be started by the time startActivity()
returns.
does startActivity() work as a return statement?
No.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.