setOnClickListener and findByViewId
<p>this part of my code is having a problem  </p>

<pre><code>insertButton = (Button) findByViewId(R.id.button1);  
insertButton.setOnClickListener(new OnClickListener();
</code></pre>

<p>it keeps saying method undefined for findByViewId, method for setOnClickListener not applicable  and OnClickListener cannot be resolved
here is my full code</p>

<pre><code>package edu.nyp.project;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class AddData extends Activity {
    Button insertButton = null;
    EditText shopText= null;
EditText dealText= null;
EditText locationText= null;
EditText websiteText= null;
EditText categoryText= null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.adddata);

    insertButton = (Button) findByViewId(R.id.button1);
    insertButton.setOnClickListener(new OnClickListener()
    {
        public void onClick(View v)
        {
            DBAdapter dbAdapter = new
                    DBAdapter(getApplicationContext());
            try{
                dbAdapter.open();

                String shop = shopText.getText().toString(); 
                String deal = dealText.getText().toString(); 
                String location = locationText.getText().toString(); 
                String website = websiteText.getText().toString(); 
                String category = categoryText.getText().toString(); 
            }
            catch(Exception e){
                Log.d("Add Data ", e.getMessage());
            }
            finally{
                if (dbAdapter != null)
                    dbAdapter.close();
            }
        }
    });
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.adddata, menu);
    return true;
}
}
</code></pre>

<p>may i know what is wrong?</p>
