I have the following method that brings me a balance
String rq = RequestManager.accountBalance(numeroTelefonico);
GenericController gC = new GenericController(true);
gC.accBalance(this, rq, new Response.Listener<AccountBalance>() {
@Override
public void onResponse(AccountBalance response) {
if(response.getMessageRS().getErrorCode().compareTo("0")==0){
String saldo = "";
if(response.getMessageRS().getBalance().compareTo("")==0){
saldo = response.getMessageRS().getAvailableBalance();
}
else{
saldo = response.getMessageRS().getBalance();
}}
else {
progressDialog.dismiss();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressDialog.dismiss();
}
});
This I have in the ONCREATE of my class, the problem is that as it is asynchronous it does not get loaded in time and my page continues all its process and at the first time I do not have the visible value, there is some elegant form of make the app wait ah to finish this asynchronous method to continue with the rest of the oncreate?