I have 10 users and each user has its personal information
So In my UserInformation Table i have some properties
userName , userAge , userNationality , userPassportNumber , userGender , userDateOfBirth and so on
when a user register i get all the information and send the infomation to UserInformation Table and also have a relation with it (Users -> UserInformation)
Problem is when i am getting data from the server
I use the below code
Backendless.Data.of( UserInformation.class).find(new AsyncCallback<List<UserInformation>>(){
@Override
public void handleResponse( List<UserInformation> foundUserInfo)
{
if (foundUserInfo.isEmpty()){
Toast.makeText(UserInfo.this, "No Information Is Found", Toast.LENGTH_SHORT).show();
}else {
realFullName.setText(foundUserInfo.get(0).getName());
realNationality.setText(foundUserInfo.get(0).getNationality());
realBirthDate.setText(foundUserInfo.get(0).getDateOfBirth());
}
}
@Override
public void handleFault( BackendlessFault fault )
{
}
});
i know
foundUserInfo.get(0).getDateOfBirth()
this code will return the first object from the list
what i want is to get the information of the logged in user not randomly
Currently i am getting data randomly
Suppose if i login from user wildstone i get the data of unknownUser
i want to fetch the data from the table for the user who is log in
Thanks