In my fragment class having customized listview.I have also one edit text in it to filter list records on text changed. but some how i am unable to implement it in fragmnet
here is my code :
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.activity_main, null);
llMain = (LinearLayout) view.findViewById(R.id.llMain);
llMain.setBackgroundColor(Color.GRAY);
InputSearch=(EditText)view.findViewById(R.id.search);
InputSearch.addTextChangedListener(new TextWatcher()
{
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
adapter.getFilter().filter(s);// Error on this line: create method getFilter() in customadapter
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s)
{
// TODO Auto-generated method stub
}
});
}