Error: constructor for a xyz class is not defined
<pre><code>public class MainActivity extends Activity {

    private String md5(String in) {
        MessageDigest digest;
        try {
            digest = MessageDigest.getInstance("MD5");
            digest.reset();
            digest.update(in.getBytes());
            byte[] a = digest.digest();
            int len = a.length;
            StringBuilder sb = new StringBuilder(len &lt;&lt; 1);
            for (int i = 0; i &lt; len; i++) {
                sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));
                sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));
            }
            return sb.toString();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button btn = (Button) findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                EditText text = (EditText) findViewById(R.id.editText1);
                EditText text1 = (EditText) findViewById(R.id.editText2);
                String userid = text.getText().toString();
                String pass = text1.getText().toString();

                Toast.makeText(
                        MainActivity.this,
                        "Entered " + userid + " and password entered is "
                                + pass, Toast.LENGTH_LONG).show();

                pass = md5(pass + "@string/salt");

                Toast.makeText(
                        MainActivity.this,
                        "Password after adding a salt and md5 hashing is now equal to "
                                + pass, Toast.LENGTH_LONG).show();

                /* This Line */DBAdapter db = new DBAdapter(this); // This Line.
                db.open();
                Cursor c = db.getPasswordForUserName(userid);
                if (c.moveToFirst()) {
                    if (c.getString(1) == pass) {
                        Toast.makeText(MainActivity.this,
                                "Authentication Succeded", Toast.LENGTH_SHORT)
                                .show();
                        // proceed
                    } else {
                        Toast.makeText(MainActivity.this, "@string/AuthFail",
                                Toast.LENGTH_SHORT).show();
                        // AuthFailure
                    }
                } else {
                    Toast.makeText(MainActivity.this, "@string/UserNotFound",
                            Toast.LENGTH_SHORT).show();
                    // where to from here
                }
            }
        });
    }
}
</code></pre>

<p>I am very new to Android programming. So I have taken code snippets from a lot of places and then combined them.</p>

<p>Basically what all I want to do is to query a local SQLite DB for existing value of <code>UserName</code> and <code>Password</code> + <code>salt(with md5 hash)</code>.</p>

<p>So I copied some code to create a database helper class (<code>DBAdapter</code>), which had pretty basic methods to deal with the database.</p>

<p>The problem now is that in the <code>MainActivity.java</code> file. The line marked <em>"this line"</em> in the code gives the error <em>The constructor DBAdapter(new View.OnClickListener(){}) is undefined.</em> I do not know what this means. What should I do to make it work?</p>
