Set value of hidden field with corresponding data of item selected from AutoCompleteTextView
Once you click on the place_name field, the hidden EditTexts should get the values you need to send to the database. This can be easily obtained by doing the following:
textMessage.addTextChangedListener(new TextWatcher(){ public void afterTextChanged(Editable s) { if (textMessage == "//Name of place") { editText1.setText "//whatever you need"; editText2.setText "//whatever you need"; editText3.setText "//whatever you need"; } }});
Alternatively, I would use a spinner for the place name and would code it with something similar to this:
@Override public void onClick(View arg0) {
int range = spnDonate.getSelectedItemPosition(); Donator_Name = tboxName.getText().toString(); switch(range) { case 0: editText1.setText = "//whatever you need"; editText2.setText = "//whatever you need"; editText3.setText = "//whatever you need"; break; case 1: editText1.setText = "//whatever you need"; editText2.setText = "//whatever you need"; editText3.setText = "//whatever you need"; break; case 2: editText1.setText = "//whatever you need"; editText2.setText = "//whatever you need"; editText3.setText = "//whatever you need"; break; }}
Hope this helps :)
Set the visibility of these fields to gone .
txtview.setVisibility(View.GONE);
and when you want to make them visible use
txtPromo.setVisibility(View.VISIBLE);