title: Assign a view ID programmatically in Android
body: <p>I'm trying to create a <code>RelativeLayout</code> with several children programmatically. To make the rules like <code>RelativeLayout.RIGHT_OF</code> work, the child views must have proper IDs.</p>
  
  <p>However, when I try to assign an ID, Android Studio flags it as an error:</p>
  
  <pre><code>view.setId(123);
  
  ERROR: Expected resource of type id
  </code></pre>