Buggy code:
public class LoginActivity extends ActionBarActivity implements LoaderCallbacks < Cursor > { private static final String TEMP_IP = "99.236.119.157" ; private static final int TEMP_PORT = 3455 ; private LoginActivity . UserLoginTask mAuthTask = null ; private LoginActivity . LoadFromDiskSetting mLoadFromDisk = null ; private AutoCompleteTextView mEmailView ; private EditText mPasswordView ; private CheckBox mRememberMeCheckBox ; private View mProgressView ; private View mLoginFormView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_login ) ; Intent i = getIntent ( ) ; mEmailView = ( ( AutoCompleteTextView ) ( findViewById ( email ) ) ) ; populateAutoComplete ( ) ; String userEmail = i . getStringExtra ( USER_NAME_MESSAGE ) ; if ( ! ( userEmail . equals ( "" ) ) ) { mEmailView . setText ( userEmail ) ; System . out . println ( "email<seq2seq4repair_space>view<seq2seq4repair_space>set..." ) ; } mPasswordView = ( ( EditText ) ( findViewById ( password ) ) ) ; mPasswordView . setOnEditorActionListener ( new TextView . OnEditorActionListener ( ) { @ Override public boolean onEditorAction ( TextView textView , int id , KeyEvent keyEvent ) { if ( ( id == ( id . login ) ) || ( id == ( EditorInfo . IME_NULL ) ) ) { attemptLogin ( ) ; return true ; } return false ; } } ) ; String userPassword = i . getStringExtra ( USER_PASSWORD_MESSAGE ) ; if ( ! ( userPassword . equals ( "" ) ) ) mPasswordView . setText ( userPassword ) ; Button mEmailSignInButton = ( ( Button ) ( findViewById ( email_sign_in_button ) ) ) ; mEmailSignInButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View view ) { attemptLogin ( ) ; } } ) ; Button mEmailRegisterButton = ( ( Button ) ( findViewById ( email_register_button ) ) ) ; mEmailRegisterButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View view ) { Intent i2 = new Intent ( LoginActivity . this , registerActivity . class ) ; <START_BUG> startActivityForResult ( i2 , 2 ) ; <END_BUG> } } ) ; mLoginFormView = findViewById ( login_form ) ; mProgressView = findViewById ( login_progress ) ; mLoadFromDisk = new LoginActivity . LoadFromDiskSetting ( this ) ; } private void populateAutoComplete ( ) { } public void attemptLogin ( ) { } private boolean isEmailValid ( String email ) { } private boolean isPasswordValid ( String password ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) public void showProgress ( final boolean show ) { } @ Override public Loader < Cursor > onCreateLoader ( int i , Bundle bundle ) { } @ Override public void onLoadFinished ( Loader < Cursor > cursorLoader , Cursor cursor ) { } @ Override public void onLoaderReset ( Loader < Cursor > cursorLoader ) { } private interface ProfileQuery { String [ ] PROJECTION = new String [ ] { Email . ADDRESS , Email . IS_PRIMARY } ; int ADDRESS = 0 ; int IS_PRIMARY = 1 ; } private void addEmailsToAutoComplete ( List < String > emailAddressCollection ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public class UserLoginTask extends AsyncTask < Void , Void , Boolean > { private final String mEmail ; private final String mPassword ; private String mId ; UserLoginTask ( String email , String password ) { } @ Override protected Boolean doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( final Boolean success ) { } @ Override protected void onCancelled ( ) { } } public class LoadFromDiskSetting implements SharedPreferences . OnSharedPreferenceChangeListener { private boolean loadFromDisk ; public LoadFromDiskSetting ( Context context ) { } public void onSharedPreferenceChanged ( SharedPreferences prefs , String key ) { } } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
startActivityForResult ( i2 , 1 ) ;