title: Set and Get Id in Edittext in android
body: <p>I am using Multiple Edittext in same view. So i am conflicting which editext view click. so Setting here first id and then get id. but  unable to get id, clickable edittext's. </p>
  
  <p><strong>My Code:</strong> <a href="http://pastebin.com/CiBkz1Yd" rel="nofollow">http://pastebin.com/CiBkz1Yd</a></p>
  
  <pre><code>List&lt;EditText&gt; edittext_list = new ArrayList&lt;EditText&gt;();
   Private EditText txtBox ;
  
  for(int j=0, j=&lt;3; j++){
  txtBox = new EditText(context);
  edittext_list.add(txtBox);
      txtBox.setId(j);
  }
  
      txtBox.addTextChangedListener(new TextWatcher() {
  
  
      public void afterTextChanged( Editable s) {
  
      How to get here that clicked edittext id:
      }
      });
  </code></pre>
  
  <p><strong>EDIT:</strong>
  same things works on button:</p>
  
  <pre><code>btn_guide= new Button(context);
      btn_guide.setId(j);
  
      btn_guide.setOnClickListener(new Button.OnClickListener() {
  
      @Override
     public void onClick(View v) {
       if i do this--&gt;&gt;v.getId();    then getting but how to above???
  }
  });
  </code></pre>
  
  <p>if i use focuschangelistener then works:</p>
  
  <pre><code>txtBox.setOnFocusChangeListener(new OnFocusChangeListener()
                      {
                          private int id_focus;
  
  
                          @Override
                          public void onFocusChange(View vv, boolean hasFocus) 
                          {
                              if (hasFocus == false)
                              {
                                  System.out.println("FALSE "+vv.getId());
                              }else {
                                  id_focus=vv.getId();
  
                                  System.out.println("TRUE ID "+vv.getId());
                                  for (int k = 0; k &lt; edit_text_value_list.size(); k++){
                                      if (edit_text_value_list.get(k).getId() == id_focus) {
                                          Toast.makeText(context, "you have clicked=="+elemName.get(k).toString()+ edit_text_value_list.get(k).getText().toString(), 5000).show();
                                      }
                                  }
  </code></pre>