i want to select the contact using autocomplete textview for sending sms. I have almost achieved what i want, but for one minute problem as you can see in the image. How can
With an AutoCompeleteTextView its can be useful just to do as what @user936414 said, but it can makes problem if you have biggest app, even more with an multiAutoCompeleteTextView so it s recommended to overide toString methode by creating a "custom" HashMap like that :
public class ContactMap extends HashMap {
/*
* (non-Javadoc)
*
* @see java.util.AbstractMap#toString()
*/
@Override
public String toString() {
if (isEmpty()) {
return "{}";
}
StringBuilder buffer = new StringBuilder(size() * 28);
Iterator> it = entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = it.next();
Object key = entry.getKey();
if (key == "Name") {
Object value = entry.getValue();
buffer.append(value);
} else {
if (key == "Phone")
buffer.append("<");
Object value = entry.getValue();
if (value != this) {
buffer.append(value);
} else {
buffer.append("(this Map)");
}
if (key == "Phone")
buffer.append(">");
}
}
return buffer.toString();
}
}
and use it like this
// Using our custom HashMap
ContactMap NamePhoneType = new ContactMap();