java - Breaking out of a do while loop in an async task after parsing all data in a URLConnection -
how end while loop if there 1 line of data or if next line empty?
bufferedreader in = new bufferedreader(new inputstreamreader(is)); string inputline = ""; try { { jsondata += inputline; } } while ((inputline = in.readline()) != null); }
you can use,
while ((inputline = in.readline()) != null && !inputline.isempty());
Comments
Post a Comment