Как отобразить индикатор выполнения, я вызываю намерение из класса А в класс Б.
В каком классе B загружаются данные из среднего
это происходит, я получаю пустой экран в это время, я хотел бы показать
Прогбар, как я могу это сделать.
Сейчас я пишу код следующим образом ...
class A extends Activity{
oncreate(){
...
Button b1 = (Button) findViewById(R.id.button1);
b1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
new performBackgroundtask().execute();
}
}
class performBackgroundtask extends AsyncTask<Void, Void, Void> {
//
ProgressDialog progressDialog = new ProgressDialog(Main.this);
@Override
protected void onPreExecute() {
progressDialog = ProgressDialog.show(Main.this,"", "Please wait...");
super.onPreExecute();
/*
* progressDialog.setMessage("Please wait while loading ...");
* progressDialog.show(); progressDialog.setCancelable(true);
*/
}
@Override
protected Void doInBackground(Void... params) {
Intent in = new Intent(A.this, B.class);
startActivity(in);
// TODO Auto-generated method stub
return null;
}
@Override
protected void onPostExecute(Void result) {
progressDialog.dismiss();
}
}
}
class B { ...
/*
* In which this class has another view which has to get the data from
* URL using SAXPArsing.
*
* ... for this where i need to write progress bar code.
*/
}