java.lang.StringIndexOutOfBoundsException: length=0; regionStart=0; regionLength=2

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Expert tip

This is a bug when using Micromax devices with VideoView. You can either exclude these devices or look at this workaround:

via GitHub by Omertron

You need to make sure that capitalisation of the case for the plugin in the properties file is exactly: "AllocinePlugin" and not "allocineplugin"

Solutions on the web

via Stack Overflow by Farhan Shah
, 1 year ago
length=0; regionStart=0; regionLength=2
via by Unknown author, 2 years ago
via Stack Overflow by João Nobre
, 1 year ago
length=0; regionStart=0; regionLength=-2
via Stack Overflow by Vinay Wadhwa
, 2 years ago
via Stack Overflow by Dahnark
, 2 months ago
length=0; regionStart=0; regionLength=1
java.lang.StringIndexOutOfBoundsException: length=0; regionStart=0; regionLength=2
at java.lang.String.startEndAndLength(
at java.lang.String.substring(
at com.buzzador.profile.getValidPhoneNumber(
at com.buzzador.profile.setDataForServer(
at com.buzzador.profile$5.onClick(
at android.view.View.performClick(
at android.view.View$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(

Users with the same issue

2 times, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
59 times, 1 month ago
Once, 4 months ago
36 times, 5 months ago
109 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.