title: how to get edittext values to be compared with database values in dialog box
body: <p>I have a dialog box which asks the user for login credentials. I want to compare that password with the database value earlier stored for authentication. M not able to do that.
  can anybody pls help.</p>
  
  <pre><code>public void onClick(View v) {
      // TODO Auto-generated method stu
      Toast.makeText(context, "Button Clicked", Toast.LENGTH_SHORT).show();   
      String existPin=exist_pin.getText().toString();
      String confirmPin=new String();
      prefEditor.putString("ExistPin", existPin);
      prefEditor.commit();
      WayDataBase way=new WayDataBase(LoginActivity.this);
      String storedPin=way.getPin(confirmPin);
      Toast.makeText(context, "Data from database", Toast.LENGTH_SHORT).show();
      if(existPin.equals(storedPin))
      {
          d2.dismiss();
          Intent i=new Intent(getApplicationContext(),ApplicantPage1.class);
          startActivity(i);
      }
      else
      {
          Toast.makeText(context, "Invalid credentials", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>