Android add text in a drawable button
<p>How can I add text in a drawable image button without adding text with classic way at main xml file with the command "android:text="test", but I want to add the text of the image button in the drawable xml (code 2).</p>

<p>Code 1 - main.xml:</p>

<pre><code>     &lt;ImageButton
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true"
        android:src="@drawable/start_off"
        android:text="TEST"
        android:background="@null"/&gt;
</code></pre>

<p>Code 2 - drawable xml button:</p>

<pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;

&lt;!-- Define the background properties like color etc --&gt;
&lt;item android:id="@android:id/background"&gt;
    &lt;shape
        android:shape="oval"&gt;

        &lt;gradient
            android:angle="270"
            android:startColor="#990000"
            android:endColor="#ff0000"
            /&gt;

        &lt;corners
            android:radius="4dp"
            /&gt;

        &lt;size
            android:width="120dp"
            android:height="120dp"
            /&gt;

    &lt;/shape&gt;
&lt;/item&gt;
</code></pre>

<p></p>