When I write the code below, it says that the method getReadableDatabase() is undefined for dbHelper, what is the problem with it?
public void checklogin(String logged){
DatabaseAdapter dbHelper = new DatabaseAdapter(LoginActivity.this);
db = dbHelper.getReadableDatabase();
Cursor mCursor = db.query(dbHelper.TABLE_USERS,new String[]{"select * from users"}, " Name like" + "'logged+'",null,null,null,null);
if (mCursor.moveToFirst()){
Toast.makeText(LoginActivity.this, "Yaaaay", Toast.LENGTH_LONG).show();
}
Toast.makeText(LoginActivity.this, "invalid", Toast.LENGTH_LONG).show();
}
}
What’s your implementation of
DatabaseAdapter? It’s not part of the Android framework. The only class that I know of that implementsgetReadableDatabase()is SQLiteOpenHelper.