当我写下面的代码时,它说该方法getReadableDatabase()
是 undefined for dbHelper
,这是什么问题?
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();
}
}