[ad_1]
just add a test :
String firstWords = "";
if(splitVideoTitle.length>1){
firstWords = splitVideoTitle[0] + " " + splitVideoTitle[1];
}
else firstWords=splitVideoTitle[0];
0
[ad_2]
solved Splitting a string caused ArrayIndexOutOfBoundsException [duplicate]