Shared preference implementation

This commit is contained in:
Krish 2023-04-13 19:35:13 +05:30
parent 1d27cca48b
commit 8e83728485

View File

@ -112,8 +112,8 @@ public class MainActivity extends AppCompatActivity {
System.out.println("Value of passAvail "+ passAvail);
Intent intent = getIntent();
passAvail = intent.getStringExtra("password");
System.out.println("Value of pass " + passAvail);
String newPass = intent.getStringExtra("password");
System.out.println("Value of newPass " + newPass);
if (!ensureBleExists())
@ -525,8 +525,8 @@ public class MainActivity extends AppCompatActivity {
public void onClick(View view) {
String userPass = edtPass.getText().toString().trim();
System.out.println("Value of userPass "+userPass);
//if(userPass.equals(password)){
if(userPass.equals("test")){
if(userPass.equals(passAvail)){
//if(userPass.equals("test")){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(KEY_PASS,userPass);
editor.apply();