Shared preference implementation
This commit is contained in:
parent
1d27cca48b
commit
8e83728485
@ -112,8 +112,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
System.out.println("Value of passAvail "+ passAvail);
|
System.out.println("Value of passAvail "+ passAvail);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
passAvail = intent.getStringExtra("password");
|
String newPass = intent.getStringExtra("password");
|
||||||
System.out.println("Value of pass " + passAvail);
|
System.out.println("Value of newPass " + newPass);
|
||||||
|
|
||||||
|
|
||||||
if (!ensureBleExists())
|
if (!ensureBleExists())
|
||||||
@ -525,8 +525,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
String userPass = edtPass.getText().toString().trim();
|
String userPass = edtPass.getText().toString().trim();
|
||||||
System.out.println("Value of userPass "+userPass);
|
System.out.println("Value of userPass "+userPass);
|
||||||
//if(userPass.equals(password)){
|
if(userPass.equals(passAvail)){
|
||||||
if(userPass.equals("test")){
|
//if(userPass.equals("test")){
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
editor.putString(KEY_PASS,userPass);
|
editor.putString(KEY_PASS,userPass);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user