You can move the code you want to execute to a separate method:
public void someAction(JsonType json);
{
Racuni racun = getInsertResponse(requestInsert(base64EncodedCredentials, json, httpclient1));
// the rest of the code that uses racun, etc.
}
And then call it from your dialog's onClick()
method:
YourActivity.this.someAction(json);
Note that any code after show()
of AlertDialog
is executed immediately. show()
is not blocking the flow.