It might be an easy question but I have been working on it for hours and couldn't solve it. Sorry if it was asked before.
In my activity I have 2 Fragments. In one fragment I am getting JSON from server and putting in ArrayList. After putting in ArrayList I have to add another fragment passing first value in ArrayList.
Here is the problem, I want to add Fragment when my ArrayList is completed, after it got all values from server. I am making service call in my onActivityCreated()
method, server call is happening in another class and I am getting Bundle in a method called onRequestFinished()
and I am putting JSON to ArrayList in this Overridden method.
P.S. I tried to put AsyncTask but I couldn't make it since I have to wait the response from onRequestFinished()
method.
How can I handle it and complete Fragment Transaction after filling my ArrayList?
Thanks