I am trying to set the log in system on android using a username check between what the user inputs and what exists in the DB
Here is my piece of code, but it always gives me "invalid" and if i take the Try Catch block, it gives me a nullpointerException
public void checklogin(String logged){
SQLiteDatabase db = null;
DatabaseAdapter database = new DatabaseAdapter(this);
try{
Cursor mCursor = db.query(database.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();
}}
catch(NullPointerException e){
Toast.makeText(LoginActivity.this, "invalid", Toast.LENGTH_LONG).show();
}
}