I have one button in the main.xml which will link to another xml which include information from server. I include progress bar to avoid the blank screen while the system is
Did you try Asyntask? Your doing process will be update in UI.
public final class HttpTask
extends
AsyncTask {
private HttpClient mHc = new DefaultHttpClient();
@Override
protected String doInBackground(String... params) {
publishProgress(true);
// Do the usual httpclient thing to get the result
return result;
}
@Override
protected void onProgressUpdate(Boolean... progress) {
// line below coupled with
// getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS)
// before setContentView
// will show the wait animation on the top-right corner
MyActivity.this.setProgressBarIndeterminateVisibility(progress[0]);
}
@Override
protected void onPostExecute(String result) {
publishProgress(false);
// Do something with result in your activity
}
}