I have a question regarding the generated code from the console for crud operations. I noticed that the activities have static methods for retrieving the results loaded from find operations like so
public static BackendlessCollection getResultCollection()
public static Object getResultObject()
Is this something that is recommended, or something that the sample code is using for demonstrations purposes and ease of access? I am asking this, because I was thinking of doing the same before I even saw the code, in order to have a reference of the loaded/updated object(s), so I do not have to re-create it after an activity has modified it.
What I mean by that is the following. Imagine you have a List activity, displaying a list of objects, the user selects one of them, a new activity launches that shows its details, they modify the object and save it to the server. Now, after the detail activity finishes, we need to update the list to reflect the changes.
Since in android there is no passing data objects around (unless they are parcable) we have to reload the list from the server to have the updated result.
Using what I have seen in the sample generated code, we can use that and get the reference of the updated object, and update our list through that.
Is that the way things should be done? Or is there another way?
Thank you for any responses!