i wrote an AsynkTask witch connect to a DB and then put the result in the UI. this works perfectly, but then i wanna include a Dialog or something, other Layout witch show a progressBar and then update the UI.
well, now the layout changes, and at the end i have the "testGUI" layout, but it doesn't upgrade with the AsynkTask Data. Here's the code. Thank you so much.
class DatabaseAsync extends AsyncTask {
@Override
protected void onPreExecute(){
setContentView(R.layout.loading);
}
/**
* Se ejecuta en el hilo secundario, en segundo plano
*/
@Override
protected JSONArray doInBackground(Void... params) {
JSONArray jArray = new JSONArray();
jArray = DatabaseController
.rellenarArray("SomeURL");
return jArray;
}
/**
* Una vez terminado el hilo secundario se ejecuta esto
*/
@Override
protected void onPostExecute(JSONArray jArrayFull) {
setContentView(R.layout.testgui);
getQuestion(jArrayFull,1);
}
}