Buggy code:
@ SuppressWarnings ( "ALL" ) public class LoginActivity extends Activity { private String username ; private String password ; private ProgressBar progressBar ; private FloatingActionButton loginButton ; private FloatingActionButton loginButtonCompat ; private TextView forgotLabel ; private Button signupButton ; private EditText username_edittext ; private EditText password_edittext ; private Handler handler ; private SessionManager sessionManager ; private ConfigManager configManager ; private CustomAutoCompleteTextView cityAutocompleteTextBox ; private CustomAutoCompleteTextView districtAutocompleteTextBox ; private Spinner spinnerCity ; private Spinner spinnerDistrict ; List < District > districtsList ; List < City > citiesList ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; sessionManager = new SessionManager ( getApplicationContext ( ) ) ; if ( sessionManager . isLoggedIn ( ) ) { if ( ( sessionManager . getAccessToken ( ) ) != null ) { <START_BUG> startService ( new Intent ( this , UpdateService . class ) . putExtra ( KEY_METHOD , UPDATE_ALL ) ) ; <END_BUG> startActivity ( new Intent ( this , HomeActivity . class ) ) ; finish ( ) ; } else { showToastMsg ( "Session<seq2seq4repair_space>expired!" ) ; } } setContentView ( activity_login ) ; spinnerCity = ( ( Spinner ) ( findViewById ( signin_city ) ) ) ; spinnerDistrict = ( ( Spinner ) ( findViewById ( spinner_district ) ) ) ; loginButton = ( ( FloatingActionButton ) ( findViewById ( signin_submit ) ) ) ; loginButtonCompat = ( ( com . melnykov . fab . FloatingActionButton ) ( findViewById ( signin_submit_compat ) ) ) ; forgotLabel = ( ( TextView ) ( findViewById ( signin_forgot ) ) ) ; signupButton = ( ( Button ) ( findViewById ( signin_register ) ) ) ; progressBar = ( ( ProgressBar ) ( findViewById ( loginprogressBar ) ) ) ; username_edittext = ( ( EditText ) ( findViewById ( signin_username ) ) ) ; password_edittext = ( ( EditText ) ( findViewById ( signin_password ) ) ) ; cityAutocompleteTextBox = ( ( CustomAutoCompleteTextView ) ( findViewById ( login_spinner_autocomplete ) ) ) ; districtAutocompleteTextBox = ( ( CustomAutoCompleteTextView ) ( findViewById ( autocomplete_district ) ) ) ; cityAutocompleteTextBox . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { showToastMsg ( "Fetching<seq2seq4repair_space>municipality<seq2seq4repair_space>list,<seq2seq4repair_space>please<seq2seq4repair_space>wait" ) ; } } ) ; districtAutocompleteTextBox . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { showToastMsg ( "Fetching<seq2seq4repair_space>district<seq2seq4repair_space>list,<seq2seq4repair_space>please<seq2seq4repair_space>wait" ) ; } } ) ; View . OnClickListener onClickListener = new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { username = username_edittext . getText ( ) . toString ( ) . trim ( ) ; password = password_edittext . getText ( ) . toString ( ) . trim ( ) ; submit ( username , password ) ; } } ; ImageView imgLogo = ( ( ImageView ) ( findViewById ( applogoBig ) ) ) ; imgLogo . setOnLongClickListener ( new View . OnLongClickListener ( ) { @ Override public boolean onLongClick ( View v ) { sessionManager . setDemoMode ( ( ! ( sessionManager . isDemoMode ( ) ) ) ) ; showToastMsg ( ( "Demo<seq2seq4repair_space>Mode<seq2seq4repair_space>is<seq2seq4repair_space>" + ( sessionManager . isDemoMode ( ) ? "Enabled" : "Disabled" ) ) ) ; return false ; } } ) ; if ( ( VERSION . SDK_INT ) >= 21 ) { loginButton . setOnClickListener ( onClickListener ) ; } else { loginButton . setVisibility ( GONE ) ; loginButtonCompat . setVisibility ( VISIBLE ) ; loginButtonCompat . setOnClickListener ( onClickListener ) ; } forgotLabel . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( LoginActivity . this , ForgotPasswordActivity . class ) ; intent . setFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( intent ) ; } } ) ; signupButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { startActivity ( new Intent ( LoginActivity . this , RegisterActivity . class ) ) ; } } ) ; final InputMethodManager imm = ( ( InputMethodManager ) ( getSystemService ( INPUT_METHOD_SERVICE ) ) ) ; password_edittext . setOnEditorActionListener ( new TextView . OnEditorActionListener ( ) { @ Override public boolean onEditorAction ( TextView v , int actionId , KeyEvent event ) { if ( actionId == ( EditorInfo . IME_ACTION_DONE ) ) { username = username_edittext . getText ( ) . toString ( ) . trim ( ) ; password = password_edittext . getText ( ) . toString ( ) . trim ( ) ; submit ( username , password ) ; if ( imm != null ) { imm . toggleSoftInput ( SHOW_IMPLICIT , 0 ) ; } return true ; } return false ; } } ) ; handler = new Handler ( ) ; try { InputStream inputStream = getAssets ( ) . open ( "egov.conf" ) ; configManager = new ConfigManager ( inputStream , this ) ; inputStream . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } new LoginActivity . GetAllCitiesTask ( ) . execute ( ) ; } private void showToastMsg ( String msg ) { } private void showToastMsg ( Integer msg ) { } public void showLoginProgress ( ) { } public void hideLoginProgress ( ) { } private void submit ( final String username , final String password ) { } class GetAllCitiesTask extends AsyncTask < String , Integer , Object > { @ Override protected Object doInBackground ( String ... params ) { } } public void hideMultiCityComponents ( ) { } public void loadDistrictDropdown ( ) throws IOException { } @ SuppressWarnings ( "unchecked" ) public void loadCityDropdown ( ) { } public void loadDropdownsWithData ( final List < String > autocompleteList , final Spinner autoCompleteSpinner , final CustomAutoCompleteTextView autocompleteTextBox , final Boolean isDistrict ) { }

Fix:
startService ( new Intent ( this , UpdateService . class ) . putExtra ( KEY_METHOD , UPDATE_PROFILE ) ) ;