Untitled
for (i in 0 until indoorpoints.size) { val imgsts = indoorpoints.get(i).imgsts val imgfile = indoorpoints.get(i).file if (imgsts != null && imgsts.equals("0")) { if (imgfile != null && imgfile.length > 0) { if (isInternetAvailable(this)) { sendImage2( indoorpoints.get(i).id.toInt(), indoorpoints.get(i).compass, indoorpoints.get(i).xaxis, indoorpoints.get(i).yaxis, indoorpoints.get(i).file) } else { Toast.makeText( this, "Please check internet connection", Toast.LENGTH_SHORT ).show() } } }