1
The code below is a adapter
that I use to create an autocomplete in my application.
mAdapter = new SimpleAdapter(this, mPeopleList, R.layout.custcontview ,new String[] { "Name", "Email" }, new int[] { R.id.ccontName, R.id.ccontEmail});
This autocomplete aims to:
Mostar Nome
Show Email
Okay, here’s the problem. It is working perfectly, when I start typing it will show the options that my list has to complete correctly. But it does the search for the two fields, both by name and by email, which generates a duplicity in the display.
The fourth and fifth parameter ("FROM" "TO") :
new String[] { "Name", "Email" }, new int[] { R.id.ccontName, R.id.ccontEmail})
That’s where the logic error lies, because the FROM
I cannot put only 1 field, if I do this I have to declare only 1 TO
.
What I want is to do something like this:
mAdapter = new SimpleAdapter(this, mPeopleList, R.layout.custcontview ,new String[] { "Name"}, new int[] { R.id.ccontName, R.id.ccontEmail});
Only that way it doesn’t create Autocomplete.
What should I do to make him search (FROM) by name and send the data to (TO) ccontName
and for ccontEmail
? What solution to this problem?
I don’t work with Java but it seems that everything is well explained, I just edited the formatting and spelling problems. I was left with doubt at the time of edit
ccontName EEEE para ccontEmail
, I believe I simply wanted to emphasize and; that’s it?– brasofilo
Yeah, it looked like hexadecimal code :p
– brasofilo
checks before displaying on Toast
– Joannis
How can I do this ? Sorry, this is the first time I’m working with this feature
– Denner Rodrigues