我是java的新手,我的代码存在问题..
ListAdapter adapter = new SimpleAdapter(Activity_ListView.this, list, R.layout.list_item,
new String[]{Config.TAG_NOMOR_INVENTARIS,Config.TAG_JENIS_BARANG,Config.TAG_NAMA_BARANG,
Config.TAG_MERK,Config.TAG_TAHUN,Config.TAG_NAMA_PENGGUNA},
new int[]{R.id.nomorinventaris, R.id.jenisbarang,R.id.namabarang, R.id.merkbarang, R.id.tahunbarang, R.id.namapengguna});
listView.setAdapter(adapter);
/**
* Enabling Search Filter
* */
inputSearch.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
// When user changed the Text
Activity_ListView.this.adapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
}
});
问题是..,我想使用适配器(在简单的适配器上)onTextChanged方法..但该方法上的适配器(onTextChanged)仍然是红色的,它总是说"无法解决符号"适配器""
抱歉我的英语不好...... 如果有人想帮助我,我将非常感激..
答案 0 :(得分:0)
您已经定义并初始化了“ListAdapter适配器”。你可以使用
@echo off
setlocal enabledelayedexpansion
REM This is just an example code block to show off the alternate syntax with the %%s
for /L %%A in (1,1,1) do (
set playerlevel=5
set x=player
call echo %%!x!level%%
)
要使用过滤器,您需要创建自定义适配器类并实现可过滤。参考:Instant search with filter class