Pratik Pitale
Pratik Pitale

Reputation: 1845

How can we show app icon image on progress dialog box in android studio?

Can I add my app icon image on ProgressbarDialog box in android?

Following is my code:

progressDialog = new ProgressDialog(this);
progressDialog.setCancelable(false);
progressDialog.setMessage("...");
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

Upvotes: 0

Views: 3463

Answers (3)

W4R10CK
W4R10CK

Reputation: 5550

To add an icon to your ProgressDialog add setIndeterminateDrawable(Drawable icon) to the variable to ProgressDialog:

Example Icon

progressDialog.setIndeterminateDrawable(Drawable_Icon_From_Drawable);

Here, setIcon() will give you a title icon:

b

progressDialog.setIcon(your_icon);

Upvotes: 3

Developer
Developer

Reputation: 183

You can set app icon using setIcon() method before show().

progressDialog.setIcon(R.mipmap.ic_launcher)

Upvotes: 0

Preetika Kaur
Preetika Kaur

Reputation: 2031

progressDialog.setIcon();

Use this to set app icon on progress dialog. Pass your app icon in above method.

Upvotes: 0

Related Questions