내 애플리케이션 휴대 전화에서 연락처 목록을 가져옵니다. 연락처 목록을 통해 컨텍스트 필터/검색 메커니즘을 구현해야합니다.휴대 전화의 검색 알고리즘 연락처 android
필터 조건 : 문자가 숫자 키 (가능한 조합)에 있음에 따라 연락처 이름으로 필터 됨!
내가 각 새 번호를 입력 할 때 목록은 적절한 연락처 만 남겨두고 변경해야합니다.
여기에 좋아요.
http://i.stack.imgur.com/IXZmJ.png
I 입력 "253"와 응용 프로그램이 나 ALE를 찾습니다. 도와주세요.
private List<Contact> contacts = new ArrayList<Contact>();
private List<Contact> sortContacts = new ArrayList<Contact>();
int textlength = 0;
TextView textView;
private class CustomTextWatcher implements TextWatcher {
public void onTextChanged(CharSequence s, int start, int before,
int count) {
textlength = textView.getText().length();
for (int i = 0; i < contacts.size(); i++) {
if (textlength <= contacts.get(i).getName().length()) {
// need help here
}}}}