Test.java :
 SQLiteDatabase db=openOrCreateDatabase("data",MODE_PRIVATE,null);
    db.execSQL("CREATE TABLE IF NOT EXISTS location(ID INTEGER PRIMARY KEY AUTOINCREMENT,NAME VARCHAR(100),CBcode VARCHAR(100));");
    Cursor c1 = db.rawQuery("Select NAME from location", null);
    Cursor c2 = db.rawQuery("Select CBcode from location", null);
    if(c1==null || c2 == null)
    {
        Toast.makeText(getBaseContext(), "Database values empty, please refer Help option    befor you start using the app..", Toast.LENGTH_LONG).show();
    }
    else
    {
    c1.moveToFirst();
    c2.moveToFirst();
    int col1=c1.getColumnIndex("NAME");
           int col2=c2.getColumnIndex("CBcode");
            for(c1.moveToFirst(); c1.moveToLast(); c1.moveToNext())
            {
                    for(c2.moveToFirst(); c2.moveToLast(); c2.moveToNext())
                    {
                            if(loc_name == c1.getString(col1))
                            {
                              my_cb = c2.getString(col2);
                              c2.close();
                              c1.close();
                              Toast.makeText(getBaseContext(), "alarm has been set", Toast.LENGTH_LONG).show();
                              break;
                            }
                            else
                            {
                            //  Toast.makeText(getBaseContext(), "No such values in database, please read Help carefully before using lovisis!", Toast.LENGTH_LONG).show();
                            }
                    }
            }
    }
    db.close();
In my above code,i am trying to access the database and start a new activity when the string matches,but i am getting close was never explicitly called on database error. PLease help
 
    