So I use TextInputEditText with a max length of 8 .
If I paste "1234 1234", it will become "1234 123". My goal is for it to become "12341234"
The hard part is the max length, because if I use the usual filter or onTextChange, it won't work due to the length cutted first before it trim whitespace. It will become "1234123" instead.
So I want to trim the whitespace before it pasted to the edit text.
Any idea ?
Edit : Because every commenter never read my question. Here's why onTextChanged dont work on mine. I copy "1234 1234". When I pasted, due to max length it will be converted to "1234 123". Then go to TextWatcher Listener, or RxJava Listener. So if I put it in onTextChange,beforeTextChange,or afterTextChange, it already become "1234 123", hence I can't achieve the goal of "12341234"