Anda dapat menggunakan AsyncTask..
periksa kode kerja ini...
untuk memanggil AsyncTask gunakan New BackGround().execute();
kelas privat BackGround memperluas AsyncTask
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(Instructions.this);
pDialog.setMessage("Please wait...");
pDialog.setCancelable(false);
pDialog.show();
}
@Override
protected Void doInBackground(Void... arg0) {
// here is your background process...
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
if (pDialog.isShowing())
pDialog.dismiss();
}
}