In general, there is an array that implements the ArrayList<MyModel>
model. How to implement a search on it?
if(MyPlayer.LastPlay.contains(t)==true){ }
t
type String
. Returns always false
. Even if there is such a string in the array
Model code
public class ModelMusic { String title; String album; String src; ModelMusic(String t, String a, String s){ title=t; album=a; src=s; } public String getTitle(){ return title; } public String getAlbum(){ return album; } public String getSrc(){ return src; } }
list.indexOf
" will suit you - zRrrLastPlay
does not contain any strings, but some other objects, or you are trying to check for the presence in the list of a string containing the substringt
. Show the announcementMyPlayer.LastPlay
. - zRrr