I am actually trying to do card formatting, for that I am trying to implement what google says from link
You are not told where the change took place because other afterTextChanged() methods may already have made other changes and invalidated the offsets. But if you need to know here, you can use setSpan(Object, int, int, int) in onTextChanged(CharSequence, int, int, int) to mark your place and then look up from here where the span ended up.
From above what I understand is I need to save [CharSequence s, int start, int before, int count] using setSpan in onTextChanged() and somehow retrieve them back in afterTextChanged().
Question is, on which object do I call setSpan() in onTextChanged() and how do I retrieve those saved values in afterTextChanged().