Commit 48b89ad7 authored by james.clarke2's avatar james.clarke2

.java

parent d09b5d39
package com.example.carrentals;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
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 goToLogin(View v) {
Intent intent = new Intent(this, Login.class);
startActivity(intent);
}
}
\ No newline at end of file
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