I really have no idea why I’m struggling with this so much. I’m scraping video ID’s from YouTube into an ArrayList and I need to remove a couple. I have tried several different ways to remove this yet none of them work.
This is what I have
while (m.find()) {
if (m.group(0) == "default.jpg")
//Do nothing
} else {
allMatches.add(m.group(0));
count++;
}
}
Then I try
int i = 0;
while (i < allMatches.size()) {
if (allMatches.get(i) == "default.jpg") {
allMatches.remove()
}
i++;
}
Also doesn’t work. And finally, when setting an image I try this
if (allMatches.get(position).toString() == "default.jpg") {
allMatches.remove(position);
bitmap = null;
}
Why are none of these working? default.jpg is definitely being picked up as it isn’t being removed from the gridview.
Alternatively, if anyone knows how to do stop the following expression from picking up ‘default.jpg’ and ‘video?view’ then I’d love to hear your suggestions.
String expr = "(?<=v=)[a-zA-Z0-9-_]{11}(?=&)|
(?<=[0-9]/)[^&\n]{11}|(?<=v=)[^&\n]{11}";
Use
.equalsMay be it works and if dont,,post your
allMatcheslist array withelement....