Hi,
You are initialize
sid
as
null
. If
readSong
has no next elements,
sid
will never be initialized. So
sid.split
is illigal.
Try:
if(sid != null) {
String[] songID = sid.split(",");
}
UPDATE
The error no occurs in situation above that I refered (but test
sid
for null).
Integer.parseInt(songID[i]);
Maybe
songID[i]
is null. I took that error in a test. If you debug it, you will get more information.
Best regards,
Filipe Marques