title: Android - How to use ObjectAnimator in XML
body: <p>I simply want to use an <code>objectAnimator</code> which is defined in a XML-file. I want to put two <code>objectAnimators</code> and want to choose in my Code which I want to use. </p>
  
  <p>This is how my XML-File looks like where I set the <code>propertyName</code>, that I wanna access later on in the code:</p>
  
  <pre><code>&lt;?xml version"1.0" encodin="utf-8"?&gt;
  &lt;set xmlns:android="..."
      &lt;objectAnimator
          android:propertyName="animX"
          android:duration="1000"
          android:valueFrom="FFFFFF"
          android:valueTo="FF0000" /&gt;
  
      &lt;objectAnimator
          android:propertyName="animY"
          android:duration="1000"
          android:valueFrom="FF0000"
          android:valueTo="FFFFFF" /&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p>That is the code, where I want to access to a <code>propertyName</code> defined <code>objectAnimator</code>:</p>
  
  <pre><code>ObjectAnimator anim = ObjectAnimator.ofFloat(view, "animX");
  anim.setTarget(anim);
  anim.start();
  </code></pre>
  
  <p>Unfortunately, that is not how it works and I am really struggling to find a solution to access the objectAnimators I want.</p>