Q:

startActivity() not called immediately?

I'm developing an Android app where the user can log in. For this every activity extends a BaseActivity. There, in the onResume() method, I check whether the user is logged in, and if not I start my LoginActivity by calling startActivity(). 
This works with every activity, except one: let's call this FailActivity.
When FailActivity is resumed, its onResume() is correctly called, which in turn calls super.onResume(), and I get to startActivity(). But the intent is never executed. Instead BaseActivity.onResume() passes execution back to FailActivity.onResume(). This produces an error because the user is not logged in.
Here is the relevant code from BaseActivity:
@Override
protected void onResume()
{
    super.onResume();
    boolean wtf = false;

    if (!loggedIn) {
        Intent intent = new Intent(this, LoginActivity.class);
        intent.putExtra(LoginActivity.EXTRA_NEXT_ACTIVITY, this.getClass().getName());
        startActivity(intent);
        wtf = true;
    }
    if (wtf)
        Log.wtf("wtf", "this should not happen");
}

I've tried calling finish() before and after startActivity(), and setting all kinds of flags in the intent, none of which do what I want.  
How can I force execution of the login intent? Why does startActivity() seem to have no effect, and why only for this one activity?

A:

With startActivity() you start asynchronous a new Activity but the user will not be able to use the first Activity, since it will been replaced as fast as possible. But keep in mind that the user may see the title of the first Activity for a short period, the content itself should not be visible however we take here about 100ms or less.
If you want to skip the code in onResume() you can use a simple return;·

