last day (15 days later) » 

9:42 PM
0
A: search bar for an activity in android application

Dhaval GondaliyaUse Edittext for Filter data from Listview. here what i have done in my Adapter class and in my activity to filter data: Adapter Class public class FindAProfessorAdapter extends ArrayAdapter<Data> implements Filterable { int layoutResourceId; LayoutInflater mInflater; Array...

 
protected FilterResults performFiltering(CharSequence constraint) { FilterResults filterResults = new FilterResults(); These two lines shows error as it asks to create class FilterResults. Anything I have to Import here.
 
Is there any problem in this line?
 
it is asking to create class FilterResults. actually the class Filterresults imported from library right!!!
 
when you will implements Filterable you have to overwrite this methods.
FilterResults filterResults = new FilterResults(); This is for returning result data to array.
 
I implemented Filterable after that i just copy paseted these methods into my adapter class
 
9:42 PM
delete that copy-paste and try to override it.
 
I Overrided it then also it shows error.
 
Check out this to make new class and extends it with Filterable.Tutorial for filter data into listview.
 
In this Link super(context, R.layout.rowlayout, list); the bold text refers to what?
I have done all that code properly. but while I am entering text into editText field the app become force closed. what is the reason behind that.
 
have you read tutorial?
 
yes I have read that. I have done according to that but while I am try to search(means enter text into edit text) the app was force closed.
 
9:42 PM
join CHAT for error solving.
 
I'm not eligible for chat room because my reputation is only 13.
If you don't mine can you answer thorough this comment only
 
You need to make 2 Arrays 1 for no filter and another for after filter data.
 
Ok. I did that.
private List<CourseTable> listv; public List<CourseTable> filteredItemsArray;
 
Then Debug code and check out logcat what is error.
 
This is my two list I have created
 
9:42 PM
Update your code in question, Put your Adapter code.
 
I'm unable to edit the code above can I send that file
 
yes. use pastebin.com for code sending.
 
I have pasted that in that website
 
save it and send that link.
 
This is my search activity pastebin.com/NaCLajvX
Did you seen that code?. Any error in that adapter class or searchActivity
 
9:42 PM
Here Try this Code: pastebin.com/Q0dbcfMu
 
I have tried this but that getfilter class and FilterResults performFiltering(CharSequence constraint) class shows error as The type Layout inflator.Filter cannot be super class of courseTableFilter. a super class must be a class
 
I have changed some code, If this time it is not working you have to debug and solve it. pastebin.com/vqCTQ6bs
 
I have tried that code. It is also not working. and Thank you so much for all this.
 

last day (15 days later) »