Skip to content Skip to sidebar Skip to footer

Display Progress While Doinbackground

While this code works, but the blank screen appears until doInBackground is complete package com.vaishnavismeclass.english.naalaayiradivyaprabandam; import android.app.ProgressD

Solution 1:

you can use AsyncTask..

check this working code...

to call AsyncTask use new BackGround().execute();

private class BackGround extends AsyncTask < Void, Void, Void> {

@OverrideprotectedvoidonPreExecute() {
        super.onPreExecute();
        pDialog = newProgressDialog(Instructions.this);
        pDialog.setMessage("Please wait...");
        pDialog.setCancelable(false);
        pDialog.show();

    }

    @OverrideprotectedVoiddoInBackground(Void... arg0) {
        // here is your background process...returnnull;

    }

    @OverrideprotectedvoidonPostExecute(Void result) {
        super.onPostExecute(result);
        if (pDialog.isShowing())
            pDialog.dismiss();
    }
}

Post a Comment for "Display Progress While Doinbackground"