title: Is it possible to have an animation-list in a dialog?
body: <p>I created a dialog:</p>
  
  <pre><code>    Dialog dialog = new Dialog(myContext, R.style.dialog_loading);
      dialog.setCancelable(false);
      RelativeLayout contentView = (RelativeLayout) ((Activity) myContext).getLayoutInflater().inflate(R.layout.dialog_loading, null);
      dialog.setContentView(contentView);
      dialog.show
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>static public Dialog PleaseWait() {
      Dialog dialog = new Dialog(myContext, R.style.dialog_loading);
      dialog.setCancelable(false);
      RelativeLayout contentView = (RelativeLayout) ((Activity) myContext).getLayoutInflater().inflate(R.layout.dialog_loading, null);
      dialog.setContentView(contentView);
      ImageView loading=(ImageView) contentView.findViewById(R.id.loading);
    loading.setBackgroundResource(R.drawable.anim_loading);
    ((AnimationDrawable) loading.getBackground()).start();
      return dialog;
  }
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>final Dialog dialog = new Dialog(My_Activity.this);
      //Set Background of Dialog - Custom 
      //dialog.getWindow().setBackgroundDrawableResource(R.drawable.dialogbg);
      //Remove the Title
      dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
      //Set the View of the Dialog - Custom
      dialog.setContentView(R.layout.dialog_loading);
      //Set the title of the Dialog
      //dialog.setTitle("Title...");
      ImageView progressSpinner = (ImageView) dialog.findViewById(R.id.loading);
  
      //Set the background of the image - In this case an animation (/res/anim folder)
      progressSpinner.setBackgroundResource(R.drawable.anim_loading);
      //Get the image background and attach the AnimationDrawable to it.
      final AnimationDrawable progressAnimation = (AnimationDrawable) progressSpinner.getBackground();
      //Start the animation after the dialog is displayed.
      dialog.setOnShowListener(new OnShowListener() {
      @Override
      public void onShow(DialogInterface dialog) {
      progressAnimation.start();
      }
      });
      dialog.show();
  </code></pre>
  
  <p>The layout xml as follows:</p>
  
  <pre><code>           &lt;RelativeLayout xmlns:tools="http://schemas.android.com/tools"
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/RelativeLayout1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@drawable/btn_black"
              android:gravity="center" &gt;
  
  &lt;ImageView
      android:id="@+id/loading"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginBottom="24dp"
      android:layout_marginLeft="30dp"
      android:layout_marginRight="30dp"
      android:layout_marginTop="24dp"
      android:src="@drawable/anim_loading"  /&gt;
  
          &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And the anim_loading as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"
  android:oneshot="false"&gt;
      &lt;item android:drawable="@drawable/loading1" android:duration="150" /&gt;
      &lt;item android:drawable="@drawable/loading2" android:duration="150" /&gt;
      &lt;item android:drawable="@drawable/loading3" android:duration="150" /&gt;
      &lt;item android:drawable="@drawable/loading4" android:duration="150" /&gt;
  &lt;/animation-list&gt;
  </code></pre>
  
  <p>The image shows, but isn't animated. How do I start this animation in a loop?</p>