Removed name
parent
3c3ed65978
commit
2edf9b728f
|
@ -209,18 +209,16 @@ public class LoginActivity extends AppCompatActivity implements
|
|||
String userString = res.body().string();
|
||||
System.out.println("Full response: " + userString);
|
||||
|
||||
String userID, userName, userSK;
|
||||
String userID, userSK;
|
||||
try {
|
||||
JSONObject user = new JSONObject(userString);
|
||||
userID = user.getString("_id");
|
||||
userName = user.getString("name");
|
||||
userSK = user.getString("sk32");
|
||||
Log.v(TAG, "User retrieved with ID: " + userID);
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "Unable to parse user JSON: ", e);
|
||||
Log.e(TAG, "JSON String used: " + userString);
|
||||
userID = null;
|
||||
userName = null;
|
||||
userSK = null;
|
||||
}
|
||||
|
||||
|
@ -229,7 +227,6 @@ public class LoginActivity extends AppCompatActivity implements
|
|||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
editor.putString("loggedInUser", userString);
|
||||
editor.putString("loggedInUserId", userID);
|
||||
editor.putString("loggedInUserName", userName);
|
||||
editor.putString("loggedInUserSk", userSK);
|
||||
editor.commit();
|
||||
|
||||
|
|
Loading…
Reference in New Issue