title: Specify target API level in Layout xml android?
body: <p>I needed to add a <code>digital clock</code> in the layout. My <code>min-supported</code> API level is 14. I found out that there is a <code>digital clock</code> widget for API level below 17 (After that it got deprecated), and there is a <code>text clock</code> for API 17 and above. </p>
  
  <p>So one thing I can do is to add both layout in xml and dynamically set the visibility based on version number in the code. But the xml will continuously show me that I have used <code>Text Clock</code> while my <code>min-supported</code> level is 14. So:</p>
  
  <ol>
  <li><p>Is there a way in the xml to specify to ignore the <code>min-sdk</code> error. Something like </p>
  
  <pre><code>@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  </code></pre></li>
  </ol>
  
  <p>That we use in the normal java code.</p>
  
  <ol start="2">
  <li><p>Is there a way in XML to specify to use a particular widget based on version number. Some kind of if else statement in the xml that says:</p>
  
  <pre><code>if((Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN) {
      //Use text clock
  } else {
      // Use digital clock
  }
  </code></pre></li>
  </ol>