title: how to make animatorInflater correct?
body: <p>I'm trying to correct <code>AnimatorInflater</code> but it doesn't work and I can't find my error.</p>
  
  <p>MainActivity.java:</p>
  
  <pre><code>package com.example.administrator.propertyanimation;
  
  import android.animation.AnimatorInflater;
  import android.animation.ObjectAnimator;
  
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  
  import android.widget.Button;
  import android.util.*;
  
  
  public class MainActivity extends ActionBarActivity {
  
      private Button mbttn;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mbttn = (Button) findViewById(R.id.btn);
  
  
          ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(MainActivity.this, R.animator.propertyanimation);
                  anim.setTarget(mbttn);
          anim.start();
  
          return ;
      }
  }
  </code></pre>
  
  <p>propertyanimation.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;objectAnimator
      android:propertyName="rotation"
      android:valueFrom="0"
      android:valueTo="360"
      android:duration="3000"
      android:repeatCount="1"
      android:repeatMode="reverse"
      android:interpolator="@android:anim/accelerate_decelerate_interpolator"/&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>This is the logcat output:</p>
  
  <pre><code>03-27 10:27:05.422    3825-3825/com.example.administrator.propertyanimation E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.example.administrator.propertyanimation, PID: 3825
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.administrator.propertyanimation/com.example.administrator.propertyanimation.MainActivity}: java.lang.ClassCastException: android.animation.AnimatorSet cannot be cast to android.animation.ObjectAnimator
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
              at android.app.ActivityThread.access$800(ActivityThread.java:135)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5001)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
              at dalvik.system.NativeStart.main(Native Method)
       Caused by: java.lang.ClassCastException: android.animation.AnimatorSet cannot be cast to android.animation.ObjectAnimator
              at com.example.administrator.propertyanimation.MainActivity.onCreate(MainActivity.java:25)
              at android.app.Activity.performCreate(Activity.java:5231)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
              at android.app.ActivityThread.access$800(ActivityThread.java:135)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5001)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
              at dalvik.system.NativeStart.main(Native Method)
  03-27 10:27:05.434      584-596/system_process W/ActivityManager﹕ Force finishing activity 
  </code></pre>
  
  <p>Then a dialog always appears that says "Unfortunely, Activity has stopped"</p>