As soon as you click on the place_name field, hidden EditTexts should get the values โโneeded to send to the database. This can be easily obtained by following these steps:
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 to name the place and encode it with something similar to this:
@Override public void onClick (Show 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 :)
source share