EditText view with Linkify enabled (autoLink="all") causes force close
<p>I'm relatively new to writing android apps and cant seem to get Linkify working with my EditText View.</p>

<p>I have a very simple application I'm using to try out some features, auto linking text. It's a single Activity with a single multiline EditText View. I have enabled Linkify in the main.xml (android:autoLink="all") so that any web, email or phone number entered in the EditText view gets linkified.</p>

<p>The issue I have is that after entering any text that should be linkified, i.e a web address, and then saving the text and exiting the app. When returning to the EditText I see the web address is now linkified but I cannot click on the EditText to enter more text as it will not give me a cursor anywhere but at the 1st position on the 1st line of the EditText. Then while clicking the screen trying to place a cursor at another line of text the app usually crashes.</p>

<p>These are the last few exceptions from the debug log:</p>

<blockquote>
  <p>java.lang.IndexOutOfBoundsException: getChars (-1 ... 0) starts before
  0
  android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:949)
  android.text.SpannableStringBuilder.getChars(SpannableStringBuilder.java:847)
  android.text.TextUtils.getChars(TextUtils.java:69)
  android.text.TextUtils.substring(TextUtils.java:255)
  android.view.inputmethod.BaseInputConnection.getTextAfterCursor(BaseInputConnection.java:339)
  com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:170)</p>
</blockquote>

<p>If the EditText is changed to a TextView Linkfiy works fine. The problem seems to be trying to edit text while it's linkified.</p>

<p>Thanks.</p>
