title: Android resource ID lost in ternary operator with methods
body: <p>This is a weird edge case I am experiencing. I am assigning a resource ID for a drawable to a variable through a ternary operator that uses methods (which return the integers representing the resource IDs). Here is an example of the issue I am running into:</p>
  
  <pre><code>private int test() {
      return R.drawable.ic_one;
  }
  
  public void main() {
      int myIcon = (true) ? test() : R.drawable.ic_two;
      imageView.setImageResource(myIcon);
  }
  </code></pre>
  
  <p>In the example above, <code>setImageResource</code> won't compile because it wants a resource ID. However, if you change the ternary operator to reference the ID directly, it works:</p>
  
  <pre><code>int myIcon = (true) ? R.drawable.ic_one : R.drawable.ic_two;
  </code></pre>
  
  <p>This would indicate that the return value (int) of <code>test()</code> was to blame, but using <code>test()</code> directly also works:</p>
  
  <pre><code>int myIcon = test();
  </code></pre>
  
  <p>Given that both the ternary operator and method return work in isolation, what about combining them makes this fail?</p>