Closed troian88 closed 10 years ago
public String doInBackground(final Void... none) { String error = ""; try { App.class.cast( LoginActivity.this.getApplication() ).authenticate(email, password); } catch (final NoAuthException ex) { error = ex.getLocalizedMessage(); } return error; } ~ Not optimal code and call method; Example: public String doInBackground(final Void... none) { try { authenticate(email, password); } catch (final NoAuthException ex) { return ex.getLocalizedMessage(); } return null; }
It is wrong to have multiple return's in one method: http://stackoverflow.com/questions/36707/should-a-function-have-only-one-return-statement
public String doInBackground(final Void... none) { String error = ""; try { App.class.cast( LoginActivity.this.getApplication() ).authenticate(email, password); } catch (final NoAuthException ex) { error = ex.getLocalizedMessage(); } return error; } ~ Not optimal code and call method; Example: public String doInBackground(final Void... none) { try { authenticate(email, password); } catch (final NoAuthException ex) { return ex.getLocalizedMessage(); } return null; }