I have a activity which has a button and 2 autocomplete widget. for the button i am using
addProductButton.setOnClickListener(this);
and for the 2 autocomplete widget i am using
supplierTextView.setOnItemClickListener(this);
now when i select the first autocomplete it runs this code but does not go into the if loop also when i click a item in the 2nd autocomplete it runs the same code but without going into the else
@Override
public void onItemClick(AdapterView<?> adapter, View view, int pos, long rowId) {
// TODO -
String supName = supplierTextView.getText().toString();
String proName = productTextView.getText().toString();
System.out.println("Name selected "+ view.getId());
if(view == supplierTextView)
{
Log.d("Supplier Name selected", supName);
}
else if(view == productTextView)
{
Log.d("Product Name selected", proName);
}
loadProducts(supName);
handleProductSuccess(filteredProduct);
}