title: How to create programmatically EditText and then get its value
body: <p>I am trying to create phone fields programmatically in a form. How to identify it and subsequently get its values?.</p>
  
  <p>The code that create the <code>EditText</code> fields and add to a form is this:</p>
  
  <pre><code>public void addTelephone(){           
            //form
            TableLayout table = (TableLayout)findViewById(R.id.table);
            //new row
            TableRow tr = new TableRow(NewRequestActivity.this);
  
            LayoutParams ltr = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
            ltr.setMargins(0, 0, 0, 2500);
            tr.setLayoutParams(ltr);
            //new field
            EditText et = new EditText(NewRequestActivity.this);
            et.setHint("telephone");
            et.setInputType(InputType.TYPE_CLASS_NUMBER);     
            et.requestFocus();
            Resources res = getResources();
            float fontSize = res.getDimension(R.dimen.input_form) / getResources().getDisplayMetrics().density;
            et.setTextSize(fontSize);
  
            LayoutParams let = new LayoutParams(0, LayoutParams.WRAP_CONTENT, 1);
  
            et.setLayoutParams(let);
  
            ImageView img = new ImageView(NewRequestActivity.this);
            img.setTag("img_"+counttelf);
            img.setImageResource(R.drawable.more);
            img.setBackgroundResource(R.drawable.imagefocused);
            img.setOnClickListener(new OnClickListener() {
                  @Override
                  public void onClick(View v) {               
  
                        v.setVisibility(View.GONE);
                        addTelephone();
                  }
              });
            LayoutParams limg = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
            img.setLayoutParams(limg);
  
            tr.addView(et, 0);
            tr.addView(img, 1);
  table.addView(tr, ++indextelf);
      }
  </code></pre>