I'm trying to produce a database in listactivity on the button click.. but I get a mistake

The technique openOrCreateDatabase(String, int, null) is undefined for that type new View.OnClickListener()" and "DefaultDBHelper can't be resolved.

Can there be in whatever way carrying this out inside a listactivity? Help !!!

my code :

reset.setOnClickListener(new OnClickListener() 
{
   private int count;
   @Override public void onClick(View v) 
   {
      SQLiteDatabase myDB = this.openOrCreateDatabase(MY_DATABASE_NAME, SQLiteDatabase.OPEN_READWRITE, null);
      try 
      { 
          /* Create the Database (no Errors if it already exists) */
          // myDB = dbHelper.getWritableDatabase();
          // dbHelper.onCreate(myDB);
          myDB.execSQL("CREATE TABLE IF NOT EXISTS " 
                       + DefaultDBHelper.MY_DATABASE_TABLE 
                       + " (LastName VARCHAR, FirstName VARCHAR," 
                       + " Country VARCHAR, Age INT(3));");

          myDB.execSQL("INSERT INTO " 
                       + DefaultDBHelper.MY_DATABASE_TABLE 
                       + " (LastName, FirstName, Country, Age)" 
                       + " VALUES ('name', 'title', 'country', 20);"); 
      }
      catch (SQLiteException e) { 
      } 
      finally { 
         if (myDB != null) 
            myDB.close(); 
      }
   }
});

u just alter the code such as this

SQLiteDatabase myDB = getBaseContext().openOrCreateDatabase(MY_DATABASE_NAME, SQLiteDatabase.OPEN_READWRITE, null);

i figured it can help u

 reset.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                 SQLiteDatabase myDB =openOrCreateDatabase("DB_NAME", MODE_WORLD_WRITEABLE ,null);



            }
        });

The next code works.I've examined it.The 'this' was refering towards the OnClickListener object you had produced there.Which was leading to the compilation error.Getting 'this' will solve the problem