I was wondering where the super.onPreExecute() for example, should be placed?
or in other words, which is the correct code:
@Override
protected void onPreExecute() {
super.onPreExecute();
RelativeLayout parent = (RelativeLayout) findViewById(R.id.layoutHomeInfo);
RelativeLayout.LayoutParams params = (LayoutParams) parent.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
progress = new ProgressBar(mContext);
parent.addView(progress, params);
}
or
@Override
protected void onPreExecute() {
RelativeLayout parent = (RelativeLayout) findViewById(R.id.layoutHomeInfo);
RelativeLayout.LayoutParams params = (LayoutParams) parent.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
progress = new ProgressBar(mContext);
parent.addView(progress, params);
super.onPreExecute();
}
Wherever you want.
Neither are wrong, it just all depends when you want to call the parent function, and that is all up to you (the developer).