Commit 8342c87e authored by james.clarke2's avatar james.clarke2

Add new file

parent 01543115
package com.example.carrentals;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class Login extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
}
public void welcomePage(View v){
EditText userName = (EditText) findViewById(R.id.userNameTxt);
EditText password= (EditText) findViewById(R.id.passwordTxt);
myDBConnector objDBConnector = new myDBConnector(this,null,null,1);
if (objDBConnector.checkLogin(userName.getText().toString(),password.getText().toString() ) ){
Intent intent = new Intent(this, Welcome.class);
startActivity(intent);
}
else{
Toast.makeText(getApplicationContext(),
"Unsuccessful login \nIncorrect credentials", Toast.LENGTH_LONG).show();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment