Hi there i have an Asynctask that wroks only problem is the screen is blank until everything has loaded so i have created a loadingcell view but i'm wanting to know how to have it show the loading view until everything is loaded.
here what i have tried but it doesn't work
public class PostTask extends AsyncTask<Void, String, Boolean> {
@Override
protected Boolean doInBackground(Void... params) {
boolean result = false;
loadFixtures();
publishProgress("progress");
loadResultsFeed();
publishProgress("progress");
loadNewsFeed();
publishProgress("progress");
return result;
}
protected void onProgressUpdate(String... progress) {
StringBuilder str = new StringBuilder();
for (int i = 1; i < progress.length; i++) {
str.append(progress[i] + " ");
loadingView = LayoutInflater.from(getBaseContext()).inflate(R.layout.loadingcell,
null);
}
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
Log.v("BGThread", "begin fillin data");
FillData();
}
}
See Question&Answers more detail:os