I'm working on an Android App using Java Language. I get into a weird problem. I'm using a third-party library that requests to a the server, get some data, make some changes to the data and then gives it to me. So on my part, I'm not doing any networking-related work. I just call the function of the library and gets the data.
Now the problem is I want to wait until the function returns the data, then the code on the next line executes. But it returns the data when the activity finishes.
I check the source code of the library on github it build around an AsyncTask and do the work in Background Thread. As I cannot change the code of the library so I want when I call the function, it waits until it finishes its work then it moves to the next line of the code to execute.
So please help me if anybody have idea how to do it.