View.getId and R.id.viewLabel return different values
<p>Let's say I have a method like this into my activity, and set it as <code>onClick</code> field of different buttons into xml:</p>

<pre><code>public void onButtonPressedFromView(View button) {
   switch(button.getId()) {
   case (R.id.button1) :
      //do something
      break;
   case (R.id.button2) :
      //do something different
      break;
   default :
      //default action
      break;
   }
}
</code></pre>

<p>It comes out that, if I press for instance button1, the id obtained with <code>button.getId()</code> is always bigger of 1 than the id obtained with <code>R.id.button1</code>. It's quite easy to solve, I just changed my code into</p>

<p><code>switch(button.getId() - 1)</code></p>

<p>but I don't like it, and would like to understand the difference between these two ways of obtaining the id of a view.</p>
