Android get view ID based on it's tag
<p>Is there any way to get the ID as in, <code>findViewById(R.id.tableLayout)</code>, based on it's XML tag?</p>

<p>For example the Java equivalent of something along these lines: 
<code>GET $id OF view WHERE 'tag' IS n</code></p>

<p>Sorry that looks more like SQL, but I thought it would make my question clearer.  </p>

<p>I want to be able to find a view based on it's tag and then convert it to a button using something like this.</p>

<p><code>Button b = (Button) findViewById(android.R.id.button1);</code></p>