title: droid Login Stub Not Working Correctly
body: <p>I built a local stub to test that my login system is working. However, it's not working and I can't logon and I can't figure out why. Probably being stupid and missing something obvious but here's the code:</p>
  
  <p>In my LOGIN ACTIVITY:</p>
  
  <pre><code>btnLogin.setOnClickListener(new OnClickListener() {
  public void onClick(View v) {
  String username = etUsername.getText().toString();
  String password = etPassword.getText().toString();
  commuhelper ch = new commuhelper();      
  switch (ch.PerformLogin(username, password))
  {
  case -1:
  lblResult.setText("Could not communicate with Server.");
  break;
  case 0: 
  lblResult.setText("Login failed. Check your credentials.");
  break;
  case 1:
  lblResult.setText("Login successful");
  Intent loginIntent = new Intent(Login.this, Main.class);
  startActivity(loginIntent);
  finish();
  break;
  default:
  lblResult.setText("unexpected response.");
  break;
  }          
  }
  });
  </code></pre>
  
  <p>In my COMMUHELPER</p>
  
  <pre><code>package com.MyApp;
  public class commuhelper {
  private int LOCAL_DEBUG = 1;
  public int PerformLogin(String username, String password)
  {
  int ret_val = -2;
  if(LOCAL_DEBUG == 1)
  {
  if(username.equals("guest") &amp;&amp; password.equals("guest"))
  ret_val = 1;
  else
  ret_val = 0;
  }
  else
  {
  ret_val = -3;
  }
  return ret_val;
  }
  </code></pre>