Code still works after startActivity ()

My app welcomes spike activity, if I don't have specific credentials in my database, it should go to the login page.

Intent intent = new Intent(Splash.this, Login.class);
startActivity(intent);
Log.d("debug", "code is still executing!!!");

Problem : after my startActivity (), all the code below still executes. ("code still executing" is printed in the console).

Purpose : not to execute any code from the burst activity, go to the input activity.

+10
source share
3 answers

. startActivity() / , . , , , , .

, finish() , , . , , finish() , , finish(), . , i.e return;, finish().

:

void finish()

, . ActivityResult , onActivityResult().

+11

. startActivity() - "", , "", onPause(), onDestroy(). : http://developer.android.com/training/basics/activity-lifecycle/starting.html

+2

Android. startActivity() , . , , , , ().

0
source

All Articles