如上所述,它是自动完成的吗?一旦方向 chMYanges,我的列表是空的?不,我需要改变方向=)
我的适配器
public class ResultsAdapter extends ArrayAdapter<SearchItem> implements Filterable{
private ArrayList<SearchItem> subItems;
private ArrayList<SearchItem> allItems;// = new ArrayList<SearchItem>();
private LayoutInflater inflater;
private PTypeFilter filter;
private OnCheckedChangeListener test;
public ResultsAdapter(Context context, int textViewResourceId, ArrayList<SearchItem> items,OnCheckedChangeListener a) {
super(context, textViewResourceId, items);
//this.subItems = items;
for( int i = 0;i < items.size();i++){
subItems.add(items.get(i));
}
this.allItems = this.subItems;
inflater= LayoutInflater.from(context);
test = a;
}
我的 onCreate
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView lvr = (ListView)findViewById(R.id.search_results);
// if(savedInstanceState == null){
this.m_adapter = new ResultsAdapter(home.this, R.layout.listrow, sResultsArr,home.this);
this.specsAdapter = new FeaturesExpandableAdapter(home.this,new ArrayList<String>(),new ArrayList<ArrayList<Feature>>());
// }
lvr.setAdapter(this.m_adapter);
多谢你们