Android - How to apply custom Logo/image with animation as circular progress dialog in Android application?
<p>I am using Progress Dialog to show progress/working. I want to replace default spinner dialog with my own image with animation. I created a layout that contains an image view.then i created a frame animation (i.e. frame_animation.xml) in res/anim (also tried with placing in drawable folder) directory. Finally applied the frame_animation to image view. The animation is not working. I tried it with creating a new sample project and start this animation on a button then its working fine but when i am showing in application it's not working. </p>

<p>Following is the code snippet where i am using this progress dialog.</p>

<p>showProgressDialog();
  searchTask = new TimerTask() {</p>

<pre><code>public void run() {
  handler.post(new Runnable() {
public void run() {

    // my code ......

    progressDialog.cancel();
    }
  });
  }
};
</code></pre>

<p>t.schedule(searchTask, 6000);</p>

<p>// function showProgressDialog is as follows that is being called</p>

<p>public void showProgressDialog() {</p>

<pre><code>private ProgressDialog progressDialog;

    progressDialog = ProgressDialog.show(MainScreen.this, "",
            "", false, false);

    progressDialog.setContentView(R.layout.progressbarlayout);

    inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    progressDialog.setContentView(inflater.inflate(R.layout.progressbarlayout,null));
    imgViewLoading = (ImageView) inflater.findViewById(R.id.animationImage);

    imgViewLoading.setBackgroundResource(R.drawable.frame_animation);

    AnimationDrawable frameAnimation = (AnimationDrawable) imgViewLoading.getBackground();
    frameAnimation.start();

}
</code></pre>

<p>Any idea where i am lacking? and Thanks in advance:p</p>
