Buggy code:
public class ManageAccountsActivity extends ParentAppCompatActivity { private static String TAG = "ManageAccountsActivity" ; private String oldDefaultUser = "" ; private CustomProgressDialog progressDialog ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_manage_account ) ; setUpDefaultToolbar ( ) ; progressDialog = new CustomProgressDialog ( this ) ; ListView listview = ( ( ListView ) ( findViewById ( email_list ) ) ) ; if ( ( AppData . defaultUser ) != null ) { oldDefaultUser = defaultUser . getUsername ( ) ; } showAllAccounts ( ) ; listview . setOnItemClickListener ( new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { ListView listview = ( ( ListView ) ( findViewById ( email_list ) ) ) ; final AppUser user = ( ( AppUser ) ( listview . getItemAtPosition ( position ) ) ) ; if ( ( user . getId ( ) ) < 0 ) { <START_BUG> startActivity ( new Intent ( ManageAccountsActivity . this , OnBoardingActivity . class ) ) ; <END_BUG> return ; } final View optionListView = getLayoutInflater ( ) . inflate ( dialog_manage_account_options , null ) ; final AlertDialog dialog = CustomedDialog . getAlertDialogNoTitle ( ManageAccountsActivity . this , optionListView ) ; dialog . show ( ) ; Button openDefault = ( ( Button ) ( optionListView . findViewById ( btn_open_account ) ) ) ; Button delete = ( ( Button ) ( optionListView . findViewById ( btn_delete_account ) ) ) ; openDefault . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { new ManageAccountsActivity . CheckKeyExpirationTaskAccount ( user , optionListView , dialog ) . executeOnExecutor ( THREAD_POOL_EXECUTOR ) ; } } ) ; delete . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { CustomedDialog . getConfirmRemoveDialog ( ManageAccountsActivity . this , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface warningDialog , int which ) { if ( ( ( AppData . appUsers ) != null ) && ( ( appUsers . size ( ) ) == 2 ) ) { CamerasActivity . logOutDefaultUser ( ManageAccountsActivity . this ) ; } else { new EvercamAccount ( ManageAccountsActivity . this ) . remove ( user . getEmail ( ) , new android . accounts . AccountManagerCallback < Boolean > ( ) { @ Override public void run ( AccountManagerFuture < Boolean > future ) { try { boolean isAccountDeleted = future . getResult ( ) ; if ( isAccountDeleted ) { showAllAccounts ( ) ; } } catch ( OperationCanceledException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( AuthenticatorException e ) { e . printStackTrace ( ) ; } } } ) ; } dialog . dismiss ( ) ; } } , msg_confirm_remove ) . show ( ) ; } } ) ; } } ) ; } @ Override protected void onRestart ( ) { } @ Override public void onBackPressed ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void updateDefaultUser ( final String userEmail , final Boolean closeActivity , final AlertDialog dialogToDismiss ) { } private void showAllAccounts ( ) { } class CheckKeyExpirationTaskAccount extends CheckKeyExpirationTask { public CheckKeyExpirationTaskAccount ( AppUser appUser , View viewToDismiss , AlertDialog dialogToDismiss ) { } @ Override protected void onPostExecute ( Boolean isExpired ) { } } }

Fix:
startActivity ( new Intent ( ManageAccountsActivity . this , LoginActivity . class ) ) ;