Using findById() with relation depth (Java/Android)

Hi,

Im trying to use findById with relation depth, in the API documentation it says that the async method is this:

public void Backendless.Data.of( T.class ).findById( int relationsDepth, AsyncCallback<E> responder );
(https://backendless.com/documentation/data/android/data_relations_retrieve.htm)

which I think it’s wrong since I dont see where I’m I supposed to put the object ID.

So I would like to know how could I achive this… I saw that there is a findById() form that takes findByID(String, int, AsyncCallback<E>), but when I tried to use it with the depeth level as int, I get an exception because the callback brings a HashMap insted of an object of the Class I’m trying to get.

Hi Marcos,

If you use the method in the following form, it will bring an instance of the class back:

Backendless.Data.of( YourClass.class ).findById( objectid, relationDepth, responder )

Regards,
Mark
p.s. docs will be updated to reflect the right signature - thanks for bringing this to our attention