title: onItemClickListener for multiple AutoCompleteTextView
body: <p>I have three AutoCompleteTextView and set onItemClickListener to it,would you please help me for know which AutoCompleteTextView is clicked </p>
  
  <pre><code>public class ProductMainListViewer extends AppCompatActivity implements AdapterView.OnItemClickListener {
  
      CustomerDataBaseAdapter customerDataBaseAdapter;
      AutoCompleteTextView txtUserName;
      AutoCompleteTextView txtContactNo;
      AutoCompleteTextView txtSearchProduct;
      TextView txtDateAndTime;
      TextView txtQty;
      TextView txtSalePrize;
      TextView txtRunit;
      TextView txtWunit;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_product_main_list_viewer);
          customerDataBaseAdapter = new CustomerDataBaseAdapter(this);
          customerDataBaseAdapter = customerDataBaseAdapter.open();
          ArrayList&lt;Customer&gt; customers = new ArrayList&lt;&gt;();
          ArrayList&lt;ProductsDetails&gt; productsDetails = new ArrayList&lt;&gt;();
  
          try {
              customers = customerDataBaseAdapter.getCustomerList();
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          try {
              productsDetails = customerDataBaseAdapter.getProductList();
          } catch (Exception e) {
              e.printStackTrace();
          }
          txtUserName = (AutoCompleteTextView) findViewById(R.id.editTextUserNamecheck);
          CustomArrayAdapterAutoCmplt adapter1 = new CustomArrayAdapterAutoCmplt(this, R.layout.activity_auto_cmplt_custom, customers);
          txtUserName.setThreshold(1);
          txtUserName.setAdapter(adapter1);
          txtUserName.setOnItemClickListener(this);
  
          txtContactNo = (AutoCompleteTextView) findViewById(R.id.editTextPhoneNoNew);
          CustomPhoneArrayAdapterAutoCmplt adapter2 = new CustomPhoneArrayAdapterAutoCmplt(this, R.layout.activity_auto_cmplt_custom, customers);
          txtContactNo.setThreshold(1);
          txtContactNo.setAdapter(adapter2);
          txtContactNo.setOnItemClickListener(this);
  
          txtSearchProduct = (AutoCompleteTextView) findViewById(R.id.searchProduct);
          ProductAutoCmplt adapter3 = new ProductAutoCmplt(this, R.layout.activity_auto_cmplt_custom, productsDetails);
          txtSearchProduct.setThreshold(1);
          txtSearchProduct.setAdapter(adapter3);
          txtSearchProduct.setOnItemClickListener(this);
          txtDateAndTime = (TextView) findViewById(R.id.dateAndTime);
          txtQty = (TextView) findViewById(R.id.txtQty);
          txtSalePrize = (TextView) findViewById(R.id.txtPrize);
          txtRunit = (TextView) findViewById(R.id.txtRUnit);
          txtWunit = (TextView) findViewById(R.id.txtWUnit);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
          fab.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                          .setAction("Action", null).show();
              }
          });
  
  
      }
  
  
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          try {
              if (txtUserName.getText().equals("")) {
                  Customer item = (Customer) txtContactNo.getAdapter().getItem(position);
                  txtUserName.setText(item.getMember_name());
  
              } else {
                  Customer item = (Customer) txtUserName.getAdapter().getItem(position);
                  txtContactNo.setText(item.getContactType());
              }
  
              DateFormat df = new SimpleDateFormat("dd.MM.yyyy  'at' HH:mm:ss ");
              String date = df.format(Calendar.getInstance().getTime());
              txtDateAndTime.setText(date);
  
          } catch (Exception e) {
          }
  
  
      }
  
  
  
  }
  </code></pre>