I have one Button, and on every click of that button I want to create new EditText Dynamically.
Now my question is , I have one style in style.xml for EditText. Now how can I apply that style to this dynamically created EditText?
My Code for EditText is:
List<EditText> allEdsLabReport ;
String[] edsLabReport;
EditText LabReportNm;
AddMoreLabReport.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
LabReportNm = new EditText(CaseReport.this);
allEdsLabReport.add(LabReportNm);
TableLayout tbl2 = (TableLayout)findViewById(R.id.TableLayoutLabReport);
TableRow tr1 = new TableRow(CaseReport.this);
tr1.addView(LabReportNm);
tbl2.addView(tr1);
}
});