Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • what do method javadocs say? I ask because it often happens that tricky design decisions like that are explained in javadocs. Wild guess - this could be done to address mobile device resource limitations: passing back and forth and mutating StringBuilders could be "cheaper" than messing with / optimizing multiple instances of immutable Strings Commented May 7, 2014 at 21:44
  • @gnat See for yourself: developer.android.com/reference/android/widget/… . Yeah, performance is the obvious reason, still I believe documentation could use some warning... Commented May 7, 2014 at 21:49
  • I see. Yet another reason there: "you can cast the return value from this method to Spannable or Editable" - String wouldn't allow for that. And this makes me feel it's supposed to support frequent changes, yet another point to prefer something mutable (in mobile context), like StringBuilder: "TextView is a complete text editor..." Commented May 7, 2014 at 21:55