0
public class myView(){
AutoCompleteTextView textView;
public myView(COUNTRIES){
AutoCompleteTextView textView = new AutoCompleteTextView(this);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES);
textView.setAdapter(adapter);
}
public AutoCompleteTextView getAutoView(){
return textView;
}
}
我把AutoCompleteTextView放在一個單獨的類中,我嘗試使用它來創建這個類的對象。但是這不起作用,你能給我一個想法,我怎樣才能在Android中爲一些視圖做單獨的類。class for Android Views