Skip to content Skip to sidebar Skip to footer

BufferedReader.readline() Return Nothing In Result In Android

i am working on socket programming in android and trying to read server responce from my android application . For this i am using bufferreader.readline() but it is not returen any

Solution 1:

Id check that your socket.getInputStream() is not returning null

Also your while will never escape until an exception is thrown so id change that to be while (in.readLine() != null)

Edit

I would do this

if (socket.getInputStream() == null) {
    //deal with this 
}
else {
     while(in.readLine() != null) {
            processString();
     }
}

}

I have no idea why your socket is null but i can t see any initialisation for it


Post a Comment for "BufferedReader.readline() Return Nothing In Result In Android"