I am currently making a friend request module. The user clicks "Approve" the program adds the friend to the _User class on Parse Server. I believed the code below would do it, and it does, but the problem is that is changes the current user to the new friend that has been added. So if the current user is "Bob", and Bob adds "Mike" the new current user is Mike.

I've been experimenting with signUp(), signUpInBackground(), but neither seem to work.

ParseUser newFriend = new ParseUser();
newFriend.setUsername(friendRequestFrom); //friendRequestFrom is a String that carries a name
newFriend.signUpInBackground(new SignUpCallback() {
    public void done(ParseException e) {
        if(e == null){
            Log.i("Parse Result","Succesful!");
            Log.i("Current User",ParseUser.getCurrentUser().getUsername());
            Log.i("Parse Result","Failed " + e.toString());

0 Answers