I'm brainstorming the next phase of my project, and I'm not certain which path to take. My idea is to have 2 EditText fields, one beneath the other. When the user types a unique ID into the first field, the second field will populate automatically with corresponding text. For example, entering "X5432" in box 1 will put "1957 Thunderbird" in box 2. I estimate having about 500 value pairs to work from, so I assume a SQLite structure would be better than just using arrays. Any suggestions would be appreciated. Thanks.
Asked
Active
Viewed 575 times
0
-
Have you try ajax scripting?. – Ram Sep 06 '13 at 07:19
-
I've never worked with ajax, but if it'll do what I need it to I'll certainly give it a shot. – geek_sauce Sep 06 '13 at 07:20
1 Answers
0
I think you should use TextWatcher
.
Just get value from edittext1
Find appropriate text for edittext2
Set text to second edittext.
edittext.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // do some stuff } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // do some stuff } @Override public void afterTextChanged(Editable s) { // do some stuff } });

Ketan Ahir
- 6,678
- 1
- 23
- 45