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 is intended to:
-
Show Name
-
Show Email
The problem is as follows. It is working perfectly, when I start typing it goes showing the options that my list has to complete correctly. But it does the search for both fields, both by name and by email, which causes duplication in the display.
Thefourthandfifthparamentro("FROM" "TO"):
new String[] { "Name", "Email" }, new int[] { R.id.ccontName, R.id.ccontEmail})
This is where the logic error is, since FROM
can not only put 1 field, if I do this I have to declare only 1 TO
.
What I want is to do something like the following:
mAdapter = new SimpleAdapter(this, mPeopleList, R.layout.custcontview ,new String[] { "Name"}, new int[] { R.id.ccontName, R.id.ccontEmail});
But that way it does not create Autocomplete.
What should I do to get the name (FROM) from the name and send the data to (TO) ccontName
and to ccontEmail
? What solution to this problem?