Retrieve related data from User object (Android)

Hello,

I have a Users table with relation field to another data table and “Autoload” feature marked.
When i load the current User i can see in debugger the related table with all the data i need under the relation property.
How can i retrieve the related data as a Backendless Collection from the existing User without making online query ?

Hi Alex,

You can use the getProperty method available in the BackendlessUser class:
https://backendless.com/documentation/users/android/users_user_properties.htm

Regards,
Mark

Can i just cast the received object to the BackendlessCollection<> ?

If you retrieve the related objects from a user, it will be an array (not BackendlessCollection)

When i casting it to the array of objects it also crashes.

Object[] t = new Object[5];
t = (Object[])loggedInUser.getProperty("MyTable");

Can you please give me a working example ?

Regards,
Alex.

Sorry, it works.
Thank you Mark.