There is a task: you need to dynamically create a button. The description of the button is in the xml file:
<Button android:layout_width="80sp" android:layout_height="80sp" android:gravity="center_vertical" android:background="@drawable/ring_button" android:id="@+id/button5" android:enabled="false" android:layout_alignTop="@+id/button4" android:layout_alignLeft="@+id/button3" android:layout_alignStart="@+id/button3" /> As you can see, background refers to another xml file (ring_button.xml):
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#EEEEEE"/> <stroke android:width="12sp" android:color="#fff" /> </shape> How to dynamically create a button described in these files?