java - Android Studio: Searchview for images, how? -
i have gridview images on it, , search bar on top of page. know how use search bar filter text, how can filter images? there way somehow "tag" images?
thanks!
you must create data model images , use id
filter them.
public class mydatamodel { int resourceid; string imagename public mydatamodel(string name, resourceid); // constructors getters, setters, etc }
and in activity can create list data:
list<mydatamodel> data = new list(); data.add(new mydatamodel("name", r.drawable.name)) //import data
and on searchview
query listener add filter adapter
;
adapter.getfilter().filter(//name);
Comments
Post a Comment