You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getting this index out of bound exception Error No reason at all
java.lang.StringIndexOutOfBoundsException: begin 0, end 32, length 31
at java.lang.String.checkBoundsBeginEnd(String.java:4466)
at java.lang.String.substring(String.java:2517)
at java.lang.String.subSequence(String.java:2567)
at com.nitish.typewriterview.TypeWriterView$1.run(TypeWriterView.java:31)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:204)
at android.os.Looper.loop(Looper.java:291)
at android.app.ActivityThread.main(ActivityThread.java:8134)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:601)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)
here is my Implementation if you can help narrow down the issue please help
` private fun makeTypingText() {
homeBinding.searchWriterView.setCharacterDelay(80)
homeBinding.searchWriterView.animateText("Explore Deliciousness in Every Search..")
homeBinding.searchWriterView.setOnAnimationChangeListener {
Handler(Looper.getMainLooper()).postDelayed(Runnable {
if (!this@HomeFragment.isDetached) {
try {
if (index == 4) {
index = 0
}
index++
homeBinding.searchWriterView.animateText(makeTestList(index))
}catch (e:Exception){
e.printStackTrace()
}
}
}, 1500)
}
}
val animatableText: ArrayList<String> = ArrayList()
private fun makeTestList(index: Int): String {
if(animatableText.isEmpty()) {
animatableText.add("Explore Deliciousness in Every Search..")
animatableText.add("Find Flavorful Delights Here...")
animatableText.add("Explore Deliciousness...")
animatableText.add("Where Every Bite Speaks Flavor...")
animatableText.add("Uncover Delicious Treasures Instantly...")
}
return animatableText[index]
}`
The text was updated successfully, but these errors were encountered:
getting this index out of bound exception Error No reason at all
here is my Implementation if you can help narrow down the issue please help
` private fun makeTypingText() {
The text was updated successfully, but these errors were encountered: