-1
나는 자동 완료의 간단한 데모를 만든다. 나는 2230 항목이있는 문자열의 배열을 과 같이 그 이름과 코드는과 같다. "Alexandra Palace- (AAP)", 이름이 주어지며 it 코드 bracket.my 문제 내부에서 이름을 사용하지 않고 코드를 사용하여 필터링해야합니다. 입력 필드에 아무 것도 입력하지 않으면 요소의 시작 문자로 필터링합니다. 이름을 대괄호 안에있는 코드로 필터링해야합니다. 여기 필터 문제가 발생합니까?
내 코드 .. com.firstgroup.global패키지입니다; 내가 "lwy"는 "MNCRLWY- (LWY)"를 표시하지 않습니다를 입력 할 때
public class GlobalList {
public static String[] stationList={
"MNCRLWY-(LWY)",
"Lympstone Commando-(LYC)",
"Lydney-(LYD)",
"Lye-(LYE)",
"Lympstone Village-(LYM)",
"Lymington Pier-(LYP)",
"Lymington Town-(LYT)",
"Lazonby & Kirkoswald-(LZB)",
"Leeds, Whitehall (Bus)-(LZZ)",
"Macclesfield-(MAC)",
"Maghull-(MAG)",
"Maidenhead-(MAI)",
"Malden Manor-(MAL)",
"Manchester Piccadilly-(MAN)",
"Martins Heron-(MAO)",
"Margate-(MAR)",
"Manors-(MAS)",
"Matlock-(MAT)",
"Mauldeth Road-(MAU)",
"Mallow-(MAW)",
"Maxwell Park-(MAX)",
"Maybole-(MAY)",
"Millbrook (Hampshire)-(MBK)",
"Middlesbrough-(MBR)",
"Moulsecoomb-(MCB)",
"Metro Centre-(MCE)",
"March-(MCH)",
"Marne La Vallee-(MCK)",
"Morecambe-(MCM)",
"Machynlleth-(MCN)",
"Manchester Oxford Road-(MCO)",
"Manchester Victoria-(MCV)",
"Maidstone Barracks-(MDB)",
"Maidstone East-(MDE)",
"Midgham-(MDG)",
"Middlewood-(MDL)",
"Maiden Newton-(MDN)",
"Morden South-(MDS)",
"Maidstone West-(MDW)",
"MAERDY-(MDY)",
"Meols Cop-(MEC)",
"Meldreth-(MEL)",
"Menheniot-(MEN)",
"Meols-(MEO)",
"Meopham-(MEP)",
"Merthyr Tydfil-(MER)",
"Melton-(MES)",
"Merthyr Vale-(MEV)",
"Maesteg (Ewenny Road)-(MEW)",
"Mexborough-(MEX)",
"Merryton-(MEY)",
"Morfa Mawddach-(MFA)",
"Minffordd-(MFD)",
"Minffordd-(MFF)",
"Milford Haven-(MFH)",
"Mount Florida-(MFL)",
"Mansfield-(MFT)",
"Metheringham-(MGM)",
"Marston Green-(MGN)",
"Minehead-(MHD)",
"Merstham-(MHM)",
"Market Harborough-(MHR)",
"Meadowhall-(MHS)",
"Manchester Airport-(MIA)",
"Micheldever-(MIC)",
"Millfield (T & W Metro)-(MIF)",
"Mills Hill-(MIH)",
"Mitcham Junction-(MIJ)",
"Micklefield-(MIK)",
"Mill Hill Broadway-(MIL)",
"Moreton-in-Marsh-(MIM)",
"Milliken Park-(MIN)",
"Mirfield-(MIR)",
"Mistley-(MIS)",
"Milton Keynes Central-(MKC)",
"Melksham-(MKM)",
"Market Rasen-(MKR)",
"Marks Tey-(MKT)",
"Millbrook (Bedfordshire)-(MLB)",
"Mouldsworth-(MLD)",
"Milford (Surrey)-(MLF)",
"Mallaig-(MLG)",
"Mill Hill (Lancashire)-(MLH)",
"Millom-(MLM)",
"Milngavie-(MLN)",
"MILESPL-(MLP)",
"Milnrow-(MLR)",
"Melrose (Bus)-(MLS)",
"Malton-(MLT)",
"Marlow-(MLW)",
"Morley-(MLY)",
"Melton Mowbray-(MMO)",
"Markinch-(MNC)",
"Manea-(MNE)",
"Manningtree-(MNG)",
"Menston-(MNN)",
"Manor Park-(MNP)",
"Manor Road-(MNR)",
"MINZHBF-(MNZ)",
"Mobberley-(MOB)",
"Moorgate-(MOG)",
"Monifieth-(MON)",
};
}
, 당신은 내가 이것을 달성하는 방법을 알려 주시기 바랍니다 수 있습니까?
여기내 코드는 ...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.select_station);
autocompleteView = (AutoCompleteTextView) findViewById(R.id.item_autoComplete);
STATION_LIST = new String[GlobalList.stationList.length
+ GlobalExtendStationList.stationList.length];
System.arraycopy(GlobalList.stationList, 0, STATION_LIST, 0,
GlobalList.stationList.length);
System.arraycopy(GlobalExtendStationList.stationList, 0,
STATION_LIST, GlobalList.stationList.length,
GlobalExtendStationList.stationList.length);
autosuggestAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,STATION_LIST);
autocompleteView.setAdapter(autosuggestAdapter);
기다림 나는 당신을 업데이 트하려고 ... !! – user944513
더 많은 코드 정보를 ypu로 보내 주시면 업데이트 드리겠습니다 .. – user944513
전체 어댑터 클래스를 원하십니까? – JIthin