Commit 617a72c7 authored by james.clarke2's avatar james.clarke2

Add new file

parent 9984da7b
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 MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void addNewUserFun (View view) {
myDBConnector dbHandler = new myDBConnector(this, null, null, 1);
EditText name = (EditText) findViewById(R.id.nameTxt);
EditText userName = (EditText) findViewById(R.id.userNameTxt);
EditText password = (EditText) findViewById(R.id.passwordTxt);
dbHandler.addNewUser(name.getText().toString(),
userName.getText().toString(),
password.getText().toString() );
Toast.makeText(getApplicationContext(),
"Successfully registered with the following details\n"+
dbHandler.findUser(userName.getText().toString()),
Toast.LENGTH_LONG).show();
}
public void loginPageFun (View v){
Intent intent=new Intent(this,Login.class);
startActivity(intent);
}
}
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