Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
が aではなくa をTextView.getText()返すのはなぜですか? (String は CharSequence の実装です)CharSequenceString
TextView.getText()
CharSequence
String
Spannableオブジェクトが含まれている可能性があるためです。ドキュメントから:
Spannable
または setText()の引数で が呼び出された場合、このメソッドからの戻り値を それぞれまたはにキャストできます。BufferType.SPANNABLEBufferType.EDITABLESpannableEditable
setText()
BufferType.SPANNABLE
BufferType.EDITABLE
Editable