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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -