4

Everytime I use the Android Layout Inspector, I got that error, that doesn't allow me to make the inspection of my Page.

StringIndexOutOfBoundsException: String index out of range:5101

In this page a have a Very Long TextView, I think this could be the problem, because when I load a shorter Textview, I can use the Android Layout Inspector normally.

Any suggestion of what could be the problem?

Johana Lopez 1327
  • 165
  • 1
  • 3
  • 14
  • 2
    add your strings in strings.xml and then use it. – AtifSayings Jun 07 '18 at 17:14
  • Thanks, with your suggestion I was able to use the Android Layout Inspector. – Johana Lopez 1327 Jun 07 '18 at 21:00
  • I'm having similar problem, but all strings are defined and the app compiles and run just fine. – Paweł Szczur May 23 '21 at 08:57
  • 3
    @PawełSzczur I was having the same problem. In my case it was the "autofillHints" attribute on EditText. Android Studio added it automatically but it was set to nothing. Setting the value accordingly or removing the attribute completely resolved it for me. – codeman Jun 04 '21 at 07:58

1 Answers1

0

android:autofillHints added to EditText on Clicking Fix in the Layout Inspector Suggestions. The action Set the android:autofillHints = "". Simply Provided a value something like this. android:autofillHints = "Phone". You could also use String value. Something like this. android:autofillHints = "@string/phone" for this value to come from the strings values.