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 "@+id/send_button"</p>

<p>How I can get this id attribute value in Java code? I tried getXXX methods on AttributeSet class but doesnt 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 View component and I want to know whats 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 getIdAttribute() method on AttributeSet but it  just doesnt work. Anyone know any reason?</p>
