First of all thank you for your answers. Sorry for the delay, but I think that we propally live in two different time zones
.
All right, so what I am doing in onPostExecute is to deserialize a Json string (created with Gson) received by the Servlet, this way:
The Toast message is just to check on the returning message for debugging purposes and its execution applies indipendently from the rest of the code (like an indipendent popup message).
The problem is that the global field
is what I need from the caller's class in order to proceed, as I am dinamically updating the app's UI depending on the content of the Tours object, so I really need to wait for it to be ready before proceeding so to avoid a
NullPointerException.
My caller class works this way (I use code from this tutorial
Android series: custom listview items and adapters):
..but as you outlined I also get stuck within the while and the Async task never gets finished...