title: NoSuchMethodError when using ListView
body: <p>I am doing ListView Example from this <a href="http://www.vogella.com/articles/AndroidListView/article.html" rel="nofollow">site</a>. Below is my code, </p>
  
  <pre><code>public class MainActivity extends Activity 
  {
      private ListView listView;
  
      String[] values = new String[] { "A","B","C","D","E","F","G","H","I","J" };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          listView = (ListView) findViewById(R.id.listData);
      }
  
      @Override
      protected void onResume()
      {
          super.onResume();
          final ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  
          for ( int i = 0 ; i &lt; values.length ; i++ )
          {
              list.add(values[i]);
          }
  
  
          final MyAdapter adapter = new MyAdapter ( this, android.R.layout.simple_list_item_1, list );
  
          listView.setAdapter(adapter);
  
          listView.setOnItemClickListener( new AdapterView.OnItemClickListener() 
          {
              @Override
              public void onItemClick ( AdapterView&lt;?&gt; parent, final View view, int position, long id )
              {
                  final String item = ( String ) parent.getItemAtPosition(position);
                  view.animate().setDuration(2000).alpha(0)
                  .withEndAction( new Runnable()
                  {
                      @Override
                      public void run()
                      {
                          list.remove(item);
                          adapter.notifyDataSetChanged();
                          view.setAlpha(1);
                      }
                  });
              }
          });
      }
  
      private class MyAdapter extends ArrayAdapter&lt;String&gt;
      {
          HashMap&lt;String,Integer&gt; hashMap = new HashMap&lt;String,Integer&gt;();
  
          public MyAdapter( Context context, int id, List&lt;String&gt; list )
          {
              super ( context, id, list );
  
              for ( int i = 0 ; i &lt; list.size() ; i++ )
              {
                  hashMap.put( list.get(i), i );
              }
          }
  
          @Override
          public long getItemId( int position )
          {
              String item = getItem(position);
              return Long.valueOf(hashMap.get(item));
          }
  
          @Override
          public boolean hasStableIds()
          {
              return true;
          }
      }
  }
  </code></pre>
  
  <p>But when I run this code and click on the listview it thorws an error. Following is my logcat. </p>
  
  <pre><code>11-29 16:24:49.249: E/AndroidRuntime(21837): FATAL EXCEPTION: main
  11-29 16:24:49.249: E/AndroidRuntime(21837): java.lang.NoSuchMethodError: android.view.ViewPropertyAnimator.withEndAction
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at com.example.listviewexample.MainActivity$1.onItemClick(MainActivity.java:52)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.widget.AdapterView.performItemClick(AdapterView.java:292)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.widget.AbsListView.performItemClick(AbsListView.java:1394)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3024)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.widget.AbsListView$1.run(AbsListView.java:3830)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.os.Handler.handleCallback(Handler.java:605)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.os.Handler.dispatchMessage(Handler.java:92)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.os.Looper.loop(Looper.java:137)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at android.app.ActivityThread.main(ActivityThread.java:4517)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at java.lang.reflect.Method.invokeNative(Native Method)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at java.lang.reflect.Method.invoke(Method.java:511)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
  11-29 16:24:49.249: E/AndroidRuntime(21837):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>How to solve this error ?</p>