【发布时间】:2013-12-28 16:17:36
【问题描述】:
我查看了以下网站:ListView Example
其中描述了如何在使用默认适配器的列表视图中实现搜索功能,并且工作正常。
如何修改它以便我可以将其用于我的列表视图的自定义适配器?
部分代码为:
dataList = (ListView) findViewById(R.id.lvFiles);
tvQuote = (TextView) findViewById(R.id.tvDisplay);
tvQuote.setTypeface(Typeface.createFromAsset(MainActivity.this.getAssets(), "fonts/roboto.ttf"));
for (int y=0; y<strNamesOfAllah.length;y++) {
name = strNamesOfAllah[y];
meaning = strMeaning[y];
rowsArray.add(new SetRows(R.drawable.icon, name, meaning));
}
adapter = new SetRowsCustomAdapter(MainActivity.this, R.layout.customlist, rowsArray);
dataList.setAdapter(adapter);
dataList.setClickable(true);
【问题讨论】: