简体   繁体   中英

Android. How to clone Editable

Does exist some simple method to clone Editable (EditText.getText())? There is no constructor of copy so I can't simply write:

Editable documetTextCopy = new Editable(documentText.getText()); and it seems Editable doesn't implement Cloneable.

Try:

Editable old = documentText.getText();
Editable copy = Editable.Factory.getInstance().newEditable(old);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM