I have a frame layout that consists of a edittext and button (to remove the field) that i want to add multiple times to a relative layout when a user clicks a button.
I have searched but i just cant find how to do this programmatically.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" >
<EditText
android:id="@+id/inputbox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="25sp"
android:textStyle="bold"
android:hint="@string/inputhint"
android:ems="10"
android:imeOptions="actionNext"
android:singleLine="true" />
<Button
android:id="@+id/buttonremove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_gravity="right|center_vertical"
android:background="@drawable/remove" />
</FrameLayout>