Reputation: 3827
I have animated gif image and when i try to use it in ProgressDialog it wont show.
ProgressDialog dialog = new ProgressDialog(this);
dialog.setIcon(R.drawable.loading);
dialog.setTitle("Loading");
dialog.setMessage("Please wait...");
dialog.show();
What I`m doing wrong? How can I set my own loading image?
Upvotes: 1
Views: 8080
Reputation: 164
Maybe it's too late,but i have same question with you. And then i find the solution in this GitHub Code Repository And then here what i'am doing
Change your code into like this
ProgressDialog dialog = new MyCustomProgressDialog.ctor(this);
dialog.show();
and than your loading image has been change.
That code just show gif image, if you want settitle and setimage just change custom progress dialog and custom layout
Upvotes: 4
Reputation: 11571
You can use custom dialog instead of using the default ProgressDialog. Set images according to your need.
Upvotes: 0
Reputation: 654
The default loading image is not a gif image it's a combination of two images and then animating it around. view the source code it may help you in res.drawable/progress_large.xml of android.
Upvotes: 0