Пользователь пишет число и нажимает.Откроется новое действие, и я хочу создать этот дизайн с помощью кода программным способом.
Я могу это сделать, но я не знаю, как настроить мои элементы (Button- EditText ..) и как найти этоэлементы в моем коде.
Можете ли вы помочь мне, как я могу использовать 'setId' на моей стороне кода?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:orientation="horizontal">
<TextView
android:id="@+id/txtView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1."
android:textStyle="bold"
android:textSize="18sp"
android:textAlignment="center"
android:layout_weight="0.1"/>
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/question"
android:layout_weight="0.6"
android:layout_marginRight="10dp"/>
<TextView
android:id="@+id/txtView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/answer"
android:layout_weight="0.3"
android:textAlignment="center"
android:layout_marginLeft="10dp"/>
</LinearLayout>