What is a StringIndexOutOfBoundsException? How can I fix it?
Error Description Actual Reason Your code trying to create a substring with though your actual response string length is = 28, so String length is not long enough to create a substring of 500 characters. Solutions : Validate length using ternary operator ?:mTextView.setText(“Response is: “+ ((response.length()>499) ? response.substring(0,500) : “length is too short”)); Note : Ternary … Read more