How to get the android xml view element id attribute in java code
<p>Suppose I have an xml definition for a button with id as <code>@+id/send_button</code></p>

<p>How I can get this id attribute value in Java code? I tried getXXX methods on <code>AttributeSet</code> class but doesn't provide any value which has "send_button" in it. </p>

<p>Edit1:</p>

<p>Let me make it a little bit more clear.</p>

<p>I am creating a custom <code>View</code> component and I want to know what's the id value that the user of this component provided in xml file.</p>

<p>Edit2:</p>

<p>I'm not using custom attributes due to a particular reason but using </p>

<pre><code>&lt;mycomponent
     android:id="@+id/my_id"/&gt;
</code></pre>

<p>Edit 3:</p>

<p>There is a <code>getIdAttribute()</code> method on <code>AttributeSet</code> but it  just doesn't work. Anyone know any reason?</p>
