Android : How to remove text formatting when pasting from clipboard on Android

on Monday, September 1, 2014


Right now I am working on an Android application that requires allowing the user to cut copy and paste onto an edit text fields. But when I copy a formatted string from other places (i.e. a string that is underlined) and paste it on to the edit text field, it shows it as a formatted version. How do I remove this?


I have tried to add a textwatcher by adding addTextChangedListener, and in the after text change I just do edittext.setText(s.toString()+"") but this creates an infinite loop. :(


Please help! Thanks in advance.


0 comments:

Post a Comment