Firstly I would like to thank the community here on their help so far.
In a method I have to write the instructions state that I have to find a Fragment whose name includes key.
ArrayList<Fragment> collage;
Now, i have experiment with indexOf and .contains in this method, but I cannot figure it out.
I figure you have to make a string with the value "key"
String str = "key";
Then use indexOf to find the index at which "key" is found? is this right, or does indexOf work only in strings? Can anyone help point me in the right direction here? Thanks in advance.
List; at least not with Java 7. With Java 8 you could use.stream().allMatch(). With Java 7 you have to loop and extract; or if you use Guava,Iterables.filter()through aPredicateStringin a list ofFragments.equalsmethod, so it does not only work on Strings. However, aFragmentwill most likely not be equal to aString.